Community
Participate
Working Groups
Build Identifier: 20110916-0149 If you compile and run this class with the Eclipse 3.7.1 compiler level 1.7: public class Bug { public static void main(final String[] args) throws IOException { byte[] data; try (final ByteArrayOutputStream os = new ByteArrayOutputStream(); final FileOutputStream out = new FileOutputStream("test.dat")) { data = os.toByteArray(); } } } you will get this error: Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 123 in method Bug.main([Ljava/lang/String;)V at offset 58 at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) at java.lang.Class.getMethod0(Class.java:2685) at java.lang.Class.getMethod(Class.java:1620) at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:484) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:476) The problem disappears if you do one of the following: 1. remove "final FileOutputStream out = new FileOutputStream("test.dat")" 2. remove "data = os.toByteArray()" 3. change to "byte[] data = null;" 4. use the external compiler from Oracle JaJDK 1.7.0_01 Reproducible: Always Steps to Reproduce: 1. Compile the class with Eclipse 2. Execute
Most likely a dup of https://bugs.eclipse.org/bugs/show_bug.cgi?id=361053. Bug 361053 is targetted for 3.8 M4 and the fix will be available for 3.7.2.
Is the same as bug 361053, carried over the test case from here to there to add a junit. *** This bug has been marked as a duplicate of bug 361053 ***
Verified for 3.8M4 using build I20111202-0800
Verified for 3.7.2RC2 using build M20120118-0800