Eclipse with Lombok - search for getter and setter usages

Dariusz picture Dariusz · Mar 7, 2017 · Viewed 7.6k times · Source

I'm using Eclipse with Lombok. The getters and setters are generated properly but they are not visible in class body (that's the whole point, I know). However, because of that, I am unable to execute a search for usages of a getter or a setter from inside the class. So if I want to check what and where actually sets a particular value of a field, I have to execute a String search for the getter name, which is slow and may give bad results (for a field of the same name in another class, for example).

Is there a way in Eclipse to look for a getter/setter usage for a field for lombok-generated methods?

Answer

Florent Bayle picture Florent Bayle · Mar 7, 2017

You can use the Outline view: outline view showing getter/setter

Right-click on the method in the Outline view, and use "Open Call Hierarchy".

An other way to do it is to right-click on the annotation (@Setter for instance), and use "Open Call Hierarchy" on it, but it may not work with some annotations (like @Data).