How to see from where a public method is called in Eclipse using Java?

Viewed 51088

I am working on a Java project in Eclipse. Sometimes when I do refactoring I would like to see from what other classes a public method is called.

There is a primitive way to do this, that I am using now. I can comment out the method and see in what classes there is an error in Eclipse. Is there any better way to do this in Eclipse? E.g. by selecting the method signature and run a command by a key-shortcut?

6 Answers

Cntrl + Shift + G

This shows where the call is made along with the hierarchy.

enter image description here

Eclipse 4.23 (Feb. 2022, 12 years later) does add to this view with:

Show implementations of callee

The call hierarchy view can now show implementing methods as potential callee methods when viewing callees.

Callee call hierarchy -- https://www.eclipse.org/eclipse/news/4.23/images/callee_on_implementations.png

This behavior can be controlled from following preference

Call hierarchy preference -- https://www.eclipse.org/eclipse/news/4.23/images/callee_preference.png

Related