dimas
dimas

Reputation: 2597

How to display java classes in eclipse calling a method from other class

I was wondering if there is a quick way of identifying or displaying which classes are trying to call a method.

Its easy to do this if there are only few classes present. But what if there are hundreds of classes trying to call a method in other classes. It would be extremly tedious if I do this manually. Is there a plugin or some built-in functions that would do this in eclipse?

The reason am asking is I wanted to map out different classes that are calling methods from other classes for easy debugging.

Upvotes: 2

Views: 3175

Answers (2)

duemir
duemir

Reputation: 1316

You can try an eclipse's Call Hierarchy feature. It shows you all the methods which directly call the method you are interested in. You can expand each caller and see what methods call it and so on.

You can do it buy right clicking on the method and selecting an "Open Call Hierarchy" menu item or pressing Ctrl+Alt+H Hotkey.

Upvotes: 4

Right click your function, select references, and then choose what you want (generally project). That will show all the references to this function in the project. This also works for classes, variables, and probably other stuff too.

Upvotes: 8

Related Questions