Project: JDT
Bug 116342 [refactoring] [extract method] Pre/post-increment/decrement in loops allowed to be extracted
Reported: 2005-11-14 17:24:19 | Status: verified fixed

Try an extract method refactoring on the following code, indicated by the comments: import junit.framework.TestCase; public class BugTest extends TestCase{ public void testLoop(){ int x = 0; for (int i = x; i < 10; i++) //extract here... assertEquals(i,x++); //...to here } } If the refactoring were behavior preserving, the test should pass after the refactoring.

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/locals_in/A_test577.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/locals_out/A_test577.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/Selection.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/flow/InputFlowAnalyzer.java