More intelligent Eclipse "Call hierarchy"?

If I have a Java project in Eclipse, I can right-click the method name and the "Hierarchy of Open Calls". Suppose I have two interfaces: A and B, which define the x () method. Is it possible for Eclipse to use the Hierarchy of Open Calls in a more intelligent way, to show only calls x () with A until those of B are shown?

+6
java eclipse call-hierarchy
Jan 10 '11 at 18:18
source share
3 answers

Eclipse should already be doing this. If you want to test it, go to your A interface, select the x () method and run the "Open Call Hierarchy" on it. Do the same for your x () method in interface B. You should get different locations of the code, unless you have a class that implements both, which you should never do. This will not violate compilation or execution, you will simply declare the same method signature twice.

+6
Jan 10 '11 at 18:33
source share

I tried this with the often overridden toString () method. When I right-click on it and select "Hierarchy of Open Calls", Eclipse happily scans my entire workspace and returns all references to this method signature.

I often rely on Eclipse to do the opposite: I select a method call and press F3 to open the declaration. But I do not think that Eclipse will be able to go in the direction you need, from the announcement to the calling link.

+3
Jan 10 '11 at 19:05
source share

This can help remove Potential Matches from search results. Try the following:

Preferences -> General -> Search

And check "Ignore possible matches."

+2
Jan 11 2018-11-11T00:
source share



All Articles