Project: JDT
Bug 76031 [search] Unexpected behavior while refactoring member class
Reported: 2004-10-11 13:19:54 | Status: resolved wontfix

Using I200410050800. I have following class in my project: C.java: class C { void method() {} void foo() { method(); } } class CC extends C { void call() { method(); new CC().method(); } void method() {} } I copy it with new name D. I got following class: D.java class D { void method() {} void foo() { method(); } } class CC extends D { void call() { method(); new CC().method(); } void method() {} } => OK I search for reference to D.CC and find only one in call() method of D.CC: => OK Now I want to rename D.CC to D.DD. So, I select CC in D.java, launch refactoring, enter new name DD, look at preview and get 2 changes: D.java: "class CC extends D {" becomes "class DD extends D" => OK C.java: "new CC().method();" becomes "new DD().method()" => KO The second change should be made in D.java not in C.java! Also happen with 3.1 M2.

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/Checks.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameFieldProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameMethodProcessor.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/rename/RenameTypeProcessor.java