Project: JDT
Bug 227876 [move method] does not qualify field access
Reported: 2008-04-19 01:11:51 | Status: resolved fixed

Build ID: I20080409-1425 Steps To Reproduce: 1. Make the following two classes: public class SourceClass { DestinationClass destination = new DestinationClass(); public void methodToMoveToDestination(String value) { this.destination.value = value; } } public class DestinationClass { public String value; } 2. Do a Move Method on SourceClass.methodToMoveToDestination(...) to DestinationClass, and select "Keep original method as delegate to moved method." 3. After refactoring, note that SourceClass is passed as a reference (via this) to the moved method in the DestinationClass. However, it is not needed as a parameter because it is NEVER used in the moved method. This is quite annoying since it requires a Change Method Signature to be done just after the Move Method to get rid of the unnecessary parameter (SourceClass).

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