Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » find all references to virtual method(how to find all possible places from which a given method may be called)
find all references to virtual method [message #1017145] Sat, 09 March 2013 16:16 Go to next message
Ilya Shlyakhter is currently offline Ilya Shlyakhter
Messages: 1
Registered: March 2013
Junior Member
The "Find references" command for a Java method finds only places where this method is explicitly called -- not those where it may be called through an interface as a virtual method. Is there a command to find all possible invocations of a given method in the codebase? I understand that there will be some false positives, but I want to make sure no possible invocation is missed.

Thanks,

ilya
Re: find all references to virtual method [message #1017797 is a reply to message #1017145] Tue, 12 March 2013 11:00 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

With the "Ctrl+Shift+g" shortcut you have access to the "Find References" action, what you are looking for is the "Call Hierarchy" of a specific method. Select your method and use the shortcut "Ctrl+Alt+h". It will open the call hierarchy view where you can easily navigate your code to see all calls to your method as you can see it in the following screenshot.

https://lh4.googleusercontent.com/-CRzCL2FyHxg/UMXsgyYMyGI/AAAAAAAAKJU/MyOTtoVVFTY/s500/Eclipse+JDT+-+Where+Is+My+Code+Called+From+03.png

For more tips and tricks on the Eclipse Java Development Tools, have a look at the various article that I have written here.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



[Updated on: Tue, 12 March 2013 11:01]

Report message to a moderator

Previous Topic:Doubts
Next Topic:Unable to configure Apache Tomcat 7.0.35 in eclipse JEE ide
Goto Forum:
  


Current Time: Wed Apr 16 16:08:17 EDT 2014

Powered by FUDForum. Page generated in 0.01515 seconds