Project: JDT
Bug 43557 Refactoring Extract method: Renaming of parameters doesn't work properly [refactoring]
Reported: 2003-09-24 05:30:30 | Status: resolved fixed

To see the problem, take a look at the following example: public void test1() { String x = "x"; String y = "a" + x; System.out.println(x); } Select the last 2 code lines of the method and apply the refactoring extract method. In the dialog, give it a method name and rename parameter x to message. You'll get this: public void test1() { String x = "x"; extractedMethod(x); } private void extractedMethod(String message) { String y = "a" + x; System.out.println(x); } As you can see, x in the extracted method isn't renamed to message.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/parameterName_in/A_test905.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/parameterName_out/A_test905.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java