Vivek Kodira
Vivek Kodira

Reputation: 2914

Eclipse Specific: Is it possible to find references of use of derived methods in a class?

I have a class Ca which extends Cb. Method M1 is implemented in the parent (Cb). However when invoked by classes, they would typically have called Ca.M1(). I want to find all such occurrences.

Eclipse has a feature 'Find references' (Shortcut: CTRL+SHIFT+G). However, it only works on actual methods defined in a class and not on derived methods.

Is there a an easier way search for this method use in Eclipse?

Upvotes: 1

Views: 1018

Answers (2)

zvikico
zvikico

Reputation: 9825

Try nWire for Java. It gives you all possible associations within your code, for derived methods as well.

Upvotes: 1

Gábor Lipták
Gábor Lipták

Reputation: 9776

Try this plugin. This is absolutely awesome and horribly hard to understand. But anyway fun, and would do your task. http://marketplace.eclipse.org/content/browse-query

This plugin indexes your code, and then you can make queries of it. Even really complicated ones. Example to impress you:

not exists ( matching "serialVersionUID" fields in ) recursive derived classes of class "Persistent"

This stands for finding classes not having serialVersionUID and being the descendant (not just children) of "Persistent" class.

Have fun with it.

Upvotes: 1

Related Questions