Project: JDT
Bug 41597 move instance method: fails for "this"-qualified field access [refactoring]
Reported: 2003-08-15 05:29:27 | Status: resolved fixed

Field accesses of the form this.s are not handled properly. Note that they need different behavior depending on context: - As target of a MethodInvocation: => implicit "this" => remove it. - Otherwise: explicit "this". Example: move A::print() to field s ----------------------------------- package p; public class A { Second s; Second s2; public void print() { int s= 17; this.s.foo(s2); this.s2.foo(this.s); } } package p; class Second { public void foo(Second s) { } }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test12/out/B.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test21/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test21/in/Second.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test21/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test21/out/Second.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test22/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test22/in/Second.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test22/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test22/out/Second.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test23/in/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test23/in/Second.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test23/out/A.java org.eclipse.jdt.ui.tests.refactoring/resources/MoveInstanceMethod/canMove/test23/out/Second.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/InstanceMethodMover.java