I want to list the classes in jars which are using java.lang.String.replace method.
jar tvf <JAR> | awk '{print $8}' | grep class$ | sed 's/\.class$//' | xargs javap
Where <JAR>
is the name of the jar you want to examine.
I want to list the classes in jars which are using java.lang.String.replace method.
jar tvf <JAR> | awk '{print $8}' | grep class$ | sed 's/\.class$//' | xargs javap
Where <JAR>
is the name of the jar you want to examine.
Probably not the easiest way (and unfortunately without javap).
With jQAssistant, you can build a neo4j database containing all your classes, methods (and many more) as vertices and some relations a edges. Methods are related by edges with label INVOKES (see http://buschmais.github.io/jqassistant/doc/1.1.2/#:Java:Method).
So, you can use jQAssistant to initialize the database. After this, you have to create some new egdes (by using "concepts"). Then you can select all your classes that use the method String.replace.
There is a maven plugin for jQAssistant. With this, it is easy to try out.