Project: JDT
Bug 165697 [move method] Wrong order of parameters in move method if parameter for source object was added.
Reported: 2006-11-23 14:01:26 | Status: resolved fixed

The order of parameters in a moved method differs from the order of arguments in the invocations of this method if a new parameter (for the source object) was introduced. Example: BEFORE: package moveMethod.orderOfParameters.before; public class Source { Target target = new Target(); public void firstMethodToMove(String param) { secondMethodToMove(param); } public void secondMethodToMove(String param) { methodToStay(); } public void methodToStay() { }; } package moveMethod.orderOfParameters.before; public class Target { } RESULT: package moveMethod.orderOfParameters.result; public class Source { Target target = new Target(); public void methodToStay() { }; } package moveMethod.orderOfParameters.result; public class Target { public void firstMethodToMove(Source source, String param) { // Order of parameters wrong: source.target.secondMethodToMove(param, source); } public void secondMethodToMove(Source source, String param) { source.methodToStay(); } }

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