Static validation of Java application for communication errors

I have a script where I have code written against version 1 of the library, but I want to send version 2 of the library. The code is sent and therefore not changed. I am worried that it might try to access classes or library members that existed in v1 but were deleted in v2.

I decided that it would be possible to write a tool to do a simple check to see if the code would link to a newer version of the library. I appreciate that the code can still be very broken, even if there are links to the code. I think about it on the other hand - if the code is not connected, I can be sure that there is a problem.

As far as I can tell, I need to do a bytecode check for references, method calls, and library class calls, and then use reflection to check if a class / member exists.

I have three questions:

(1) Does such a tool already exist?

(2) I have a feeling of trembling, which is much more complicated than I imagine, and that I missed something important - is that the case?

(3) Do you know about a convenient library that would allow me to check the bytecode so that I can find method calls, links, etc.?

Thank!

+3
source share
5 answers

, Clirr - - :

Clirr - , Java . jar, Clirr public api. Clirr Ant , api. Clirr .

+2

IDE .

, , , , .

+2

Spring. , .

+1

, . , . , , , - IoC, Spring ..

, , .

.class , , , , , .

0

JVM/Java, ., , .

, " " , . , , .class/.jar. , , BCEL, .

I notice that you mention reflection in tags. If you load classes / invoke methods through reflection, there is no way to analyze this as a whole.

Good luck

0
source

Source: https://habr.com/ru/post/1747007/


All Articles