mardi 4 août 2015

Find potential methods that invoke a method using reflection or static code analysis

This question is not a duplicate of - How do I find the caller of a method using stacktrace or reflection?

I am trying to analyze all possible paths to a particular method for my codebase. I'm envisioning something like this:

Class clazz = MyClass.class;
Method method = clazz.getMethod("myMethod");
Method[] possibleCallers = getMethodsThatInvokeMethod(method); // <-- How do I implement this

Is this possible using reflection? If not, are there any open libraries that can help?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire