Project: JDT
Bug 229734 [inline] method inlining breaks control flow
Reported: 2008-04-30 18:47:30 | Status: verified fixed

3.4M6 Build ID: I20080330-1350 Steps To Reproduce: Please see that the first method should always print HERE. But after inlining the second method, the first method would never print HERE. Inlining breaks the control flow. ------------------ Bug.java ----------------- class Bug { void first(){ if(false) second(); else System.out.println("HERE"); } void second(){ for(int x:new int[]{0}) if(true) toString(); } }

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_in/TestDanglingIfBug229734.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_in/TestDanglingIfBug229734_2.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_out/TestDanglingIfBug229734.java org.eclipse.jdt.ui.tests.refactoring/resources/InlineMethodWorkspace/TestCases/controlStatement_out/TestDanglingIfBug229734_2.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/InlineMethodTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/SourceProvider.java