Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What tools are available to visualize what methods call other methods for Java code?

What tools are available to visualize what methods call other methods for Java code? For example, is there something like CodeDrawer that works with Java? In particular I'm looking for something that would draw arrows between Obj.methodA() and Obj.methodB() if methodA calls methodB, and maybe organizes a nice star of arrows pointing at methodB from methods that call it.

like image 593
Anonymous Avatar asked Jan 11 '12 02:01

Anonymous


People also ask

What are the ways to call a method in Java?

To call a method in Java, simply write the method's name followed by two parentheses () and a semicolon(;). If the method has parameters in the declaration, those parameters are passed within the parentheses () but this time without their datatypes specified.

How do you call a method in main method in Java?

Call a Method Inside main , call the myMethod() method: public class Main { static void myMethod() { System.out.println("I just got executed!"); } public static void main(String[] args) { myMethod(); } } // Outputs "I just got executed!"

What can be used to implement method calls?

A method must be created in the class with the name of the method, followed by parentheses (). The method definition consists of a method header and method body. We can call a method by using the following: method_name(); //non static method calling.

How do you call a method in JNI?

You can call an instance method by following these three steps: Your native method calls the JNI function GetObjectClass , which returns the Java class object that is the type of the Java object. Your native method then calls the JNI function GetMethodID , which performs a lookup for the Java method in a given class.


1 Answers

Structure101, point it at your byte code, select the structure tab, call graph perspective. You can set the depth of calls (both callers and callees) to be displayed, and double clicking on a method will centralize it on the directed graph so that the depth of calls displayed becomes relative to it. A directed graph rather than simple tree is displayed, so that multiple routes between methods can be discovered, such as between createDetectors and getShortName in the following (call depth set to 2):

enter image description here

like image 147
Chris Chedgey - Structure101 Avatar answered Oct 26 '22 12:10

Chris Chedgey - Structure101