When refactoring a field, the default behaviour in eclipse is to rename just the field, leaving accessor methods with inconsistent names.
Pressing Alt+Shift+R twice shows a “Renaming dialog” where I can select if accessors should be renamed as well (as two separate options). This eases the pain of manually renaming the accessors, but is still quite suboptimal, involving pressing 3 more shortcuts than with the in-place renaming, plus my usual forgetfulness… 🙂
I cannot think of a reason why I would NOT like my refactoring to be consistent, so is there a way to make accessor renaming the default behaviour? I’m OK with tweaking cryptic settings and setting obscure flags as long as it works.
Thank you
Just tried that in Eclipse 3.6 Helios (but I remember it works in Eclipse 3.4 and 3.5 and probably even earlier)
A single Alt-Shift-R rename in the editor, once ENTER is pressed, will change the method name of corresponding getter and setter. The prerequisite is probably you should have once open the Rename Field dialog by pressing Alt-Shift-R twice, and select options in Rename getter and Rename setter. Subsequent rename actions will remember your choice on this.