Project: JDT
Bug 132931 Extract Local Variable incorrectly moves local variable outside non-delimited loop.
Reported: 2006-03-22 21:16:28 | Status: resolved fixed

Given the method: private void test(Collection c) { for (Object o : c) System.out.println(o.toString()); } If you attempt to extract "o.toString()" as a local variable, it is placed outside the for loop. The refactoring should create braces for the for loop and place the local variable inside.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test98_in.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractTemp/canExtract/A_test98_out.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractTempTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractTempRefactoring.java