I'm working on code that's a bit of a mess right now and am doing a lot of refactoring.
Is there a way to move a field from one class to another and update the references automatically? I've used Eclipse's refactoring capabilities quite a bit, but I can't figure out a way to automate this.
For instance, ideally I would drag the private field/attribute/member from one class to another and hope that Eclipse asks me how I want to handle the unresolved references. It offers no suggestions and breaks all of the references.
The operation that I've been repeating is to separate knowledge and behavior that doesn't really belong in the current class. I'm moving attributes and behavior that references certain fields out of the original class into a new "helper" class.
The first step in my refactoring is to move the attributes. A reference to the helper class exists as a field in the class I'm refactoring from. In order not to break the code during the refactoring, I think it would be nice if Eclipse offered to to generate getters and setters and update the references so that they use the getters/setters in the new class.
Thanks!