4

Say I have the following:

public class TextField { private String value = ""; public String getValue() { return value; } } 

And:

public class TextField2 extends TextField { public String getValue() { return value; } } 

Is there any way in Eclipse to search for only instances of the getValue() method called on a TextField2 object? I'm assuming the answer is no, but figured I would ask.

1
  • 1
    TextField2 object or TextField2-typed expression? Commented Jun 2, 2015 at 15:26

1 Answer 1

9

You can do this by selecting the overriden method, pressing the key combination Ctrl+Shift+G. Or by selecting Search --> References --> Workspace from the menu. In the Search view that shows the result, click on the button with the arrow icon at the top right of the view and select References to Overriden.

enter image description here

But as @Sotirios implied in the comment, this would not detect references by variables declared of type TextField which may be instances of the subtype TextField2 at runtime.

Sign up to request clarification or add additional context in comments.

3 Comments

is this still relevant? I don't see References to Overriden in eclipse Neon
@user7294900 The option exists in Eclipse Oxygen as shown in the added image.
does not work for me. I have e xactly one call to a toString() in my Test.class, if I do a search on toString() and then 'references to overriden' I still get dozens of hits on other toString() methods from other unrelated classes.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.