Project: JDT
Bug 385550 [move method] Update reference to inherited field
Reported: 2012-07-19 16:28:33 | Status: resolved fixed

Here is original source codes: public class A { public int i = 0; } public class B extends A{ public void m(C target) { i++; } } public class C { } Now we apply MOVE refactoring to method "m()" with delegate. The result is shown below: public class A { public int i = 0; } public class B extends A{ public void m(C target) { target.m(this); } } public class C { public void m(B b) { i++; //error } } The inherited variable "i" should be updated to "b.i". -- Configuration Details -- Product: Eclipse 1.5.0.20120131-1544 (org.eclipse.epp.package.jee.product) Installed Features: org.eclipse.jdt 3.8.0.v20120525-1249-8-8nFqlFNOfwKDRGz-pXLdGxEM83

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test47/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test47/out/A.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/MoveInstanceMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/MoveInstanceMethodProcessor.java