3

I am using Eclipse (Mars) and have a public static configuration variable called by a number of different clients/java classes. I want to make this public static variable private and replace references to it with getters/setters.

I know how to automatically generate getters and setters for a variable in Eclipse, but what it doesn't do is replace all the calls to this variable with the getter/setter method just created.

My question is if there some way to do this automatically in Eclipse? I am also curious if other IDE's support this type of refactoring.

ozborn
  • 980
  • 5
  • 24
  • Berger, you called it correctly, that should fix my problem. I had no idea what encapsulate field meant when I saw it on my menu! – ozborn Mar 03 '16 at 15:33
  • I admit having discovered this feature thanks to your question :) – Arnaud Mar 03 '16 at 15:56

0 Answers0