I am trying to rename a method in my Java Eclipse project, but it seems to rename each method with the same name. (Maybe I don't understand what this function is for - maybe it's just using sed?)
Here is a simplified example:
public class C1 { interface Listener { void f(); } public C2.Listener c2l = new C2.Listener() { public void f() { } }; }
public class C2 { interface Listener { void f(); } }
If I select the method f in C2 and select “rename” from the “refactoring” menu to rename it to g , C1.Listener.f also renamed, as a result of which C1 will be changed to this:
public class C1 { interface Listener { void g(); } public C2.Listener c2l = new C2.Listener() { public void g() { } }; }
I expected this to be changed to this:
public class C1 { interface Listener { void f(); } public C2.Listener c2l = new C2.Listener() { public void g() { } }; }
Is there a way to do this by only renaming C2.Listener.f ?
I tried in Eclipse Helios and Android Development Tools 22.3.0.
source share