Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find methods calls in Eclipse project

Tags:

java

find

eclipse

I have a class X containing method myMethod(). I would like to find locations in all projects in my current workspace where this myMethod() is being called. I cannot use any search functions as there are several classes with myMethod(), and it isn't static. Hence I need to know the name of the objects of this class, which isn't possible without manually exploring the projects.

Does Eclipse have a solution for this?

like image 948
Shailesh Tainwala Avatar asked Mar 11 '11 04:03

Shailesh Tainwala


People also ask

How do you find out where a method is called?

Ctrl+Shift+G shows you from where the method is being called whereas Ctrl+Alt+H shows calls from the method in the workspace.

How do I go back a call method in eclipse?

Press Alt + Left Arrow and Alt + Right Arrow like you would in a web browser.


2 Answers

Go to the method in X.java, and select Open Call Hierarchy from the context menu.

like image 50
Thilo Avatar answered Sep 28 '22 01:09

Thilo


Select mymethod() and press ctrl+alt+h.

To see some detailed Information about any method you can use this by selecting that particular Object or method and right click. you can see the "OpenCallHierarchy" (Ctrl+Alt+H). Like that many tools are there to make your work Easier like "Quick Outline" (Ctrl+O) to view the Datatypes and methods declared in a particular .java file.

To know more about this, refer this eclipse Reference

like image 43
Nirmal- thInk beYond Avatar answered Sep 28 '22 01:09

Nirmal- thInk beYond