How to disable Eclipse code replacement for "setters"?

3

When I create a class in eclipse with an attribute of type

public class MinhaClasse{
    private String variavel;
}

Eclipse underlines the word "variable" in yellow and if I right-click on it, it allows getters and setters to be generated for that variable.

The problem is that it also overrides references in other methods of type code

variavel = x;

by

setVariavel(x);

I know this does not happen when using shift + alt + s and asks to create getters and setters for the attributes, but it is much less convenient

Is it possible to configure Eclipse to not do this override of setters ?

ps. edited to make the problem lighter

    
asked by anonymous 31.01.2014 / 13:58

2 answers

2

Just when you open the window to define the names of the methods (this after you have right-clicked, or CTRL + 1 on top of the field - in your example variavel ), you check the option keep field reference

    
31.01.2014 / 16:49
0

Window / Preferences - > Java / Debug

There are 4 Checkboxes related to Hot Code Replace. Disabling all of them will solve your problem

    
31.01.2014 / 14:57