Community
Participate
Working Groups
Build I20030422 Setup: 0) start dev workbench with I20030422 1) have JDT UI plug-in and JDT UI Refactoring tests as source 2) have I20030422 as binaries 3) rebuild all with 1.3 compliance level against 1.3.1 JRE 4) run "ExtractTempTests" as JUnit Plugin Test ==> many verify errors "Illegal target of jump or branch" (see trace below) The problem does not appear if R2.1 is used in step 0. java.lang.VerifyError: (class: org/eclipse/jdt/internal/corext/dom/fragments/ASTFragmentFactory$FragmentForSubPartBySourceRangeFactory, method: visit signature: (Lorg/eclipse/jdt/core/dom/InfixExpression;)Z) Illegal target of jump or branch at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSubPartBySourceRange(ASTFragmentFactory.java:103) at org.eclipse.jdt.internal.corext.dom.fragments.ASTFragmentFactory.createFragmentForSourceRange(ASTFragmentFactory.java:81) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.getSelectedExpression(ExtractTempRefactoring.java:685) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkSelection(ExtractTempRefactoring.java:186) at org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring.checkActivation(ExtractTempRefactoring.java:176) at org.eclipse.jdt.internal.corext.refactoring.base.Refactoring.checkPreconditions(Refactoring.java:76) at org.eclipse.jdt.ui.tests.refactoring.RefactoringTest.performRefactoring(RefactoringTest.java:133) at org.eclipse.jdt.ui.tests.refactoring.ExtractTempTests.failHelper1(ExtractTempTests.java:122) at org.eclipse.jdt.ui.tests.refactoring.ExtractTempTests.testFail25(ExtractTempTests.java:550) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.extensions.TestSetup.run(TestSetup.java:23) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276) at org.eclipse.pde.internal.junit.ui.RemotePluginTestRunner.main(RemotePluginTestRunner.java:30) at org.eclipse.pde.internal.junit.ui.UITestApplication.runEventLoop(UITestApplication.java:35) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:431) at EclipseRuntimeLauncher.main(EclipseRuntimeLauncher.java:24)
Reproduced with simpler testcase: public class X { Throwable ex; public static void main(String[] args) { new X().visit("hello world"); } public boolean visit(Object node) { try { System.out.println(node); } catch (Throwable e) { ex = e; } finally { return false; } } } Problem got introduced since R2.1, when moving the natural exit in codegen of try-statement (to save one bytecode). The last catch block is branching too far if the subroutine doesn't complete normally.
Fixed
*** Bug 37247 has been marked as a duplicate of this bug. ***
Verified.