Given a certain java method, I need to determine all the execution paths from the entry class to the target method.
Example:
target method: MyClass.myMethod()
execution paths:
EntryClass –calls–> Class1.method1() –calls–> Class2.method1() –calls–> Class2.method2() –calls–> MyClass.myMethod()
EntryClass –calls–> Class1.method1() –calls–> Class3.method1() –calls–> Class2.method2() –calls–> MyClass.myMethod()
EntryClass –calls–> Class3.method1() –calls–> MyClass.myMethod()
etc.
Is there any tool available that can run static analysis on my codebase to determine all of these code execution paths?
Does eclipse’s call hierarchy fit the bill? It displays a tree of all callers of a method, or all callees of a method (it only shows callers or callees the source code is available for, and doesn’t show calls made by reflection).
To open it, simply click on the method name, and press CtrlAltH