| Summary: | [1.7][compiler] Wrong compilation of new try-resource-clause | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Frank Ulbricht <f.ulbricht> | ||||
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> | ||||
| Status: | VERIFIED DUPLICATE | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | CC: | jarthana, srikanth_sankaran | ||||
| Version: | 3.7 | ||||||
| Target Milestone: | 3.7.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 201054 [details]
The class to reproduce the problem
This is the same problem as bug 353535. Will carry over the test case there. *** This bug has been marked as a duplicate of bug 353535 *** Verified for 3.7 RC2 with build M20110824-0800. |
Build Identifier: 20110615-0604 This code will compile without errors: import java.io.ByteArrayInputStream; import java.io.InputStream; public class Test { public static void main(String[] args) throws Exception { int b; try (final InputStream in = new ByteArrayInputStream(new byte[] { 42 })) { b = in.read(); } } At runtime this exception will occur: Exception in thread "main" java.lang.VerifyError: Stack map does not match the one at exception handler 53 in method Test.main([Ljava/lang/String;)V at offset 4 at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Unknown Source) at java.lang.Class.getMethod0(Unknown Source) at java.lang.Class.getMethod(Unknown Source) at sun.launcher.LauncherHelper.getMainMethod(Unknown Source) at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source) } If the class is compiled with the JDK all runs fine. Reproducible: Always Steps to Reproduce: 1. Compile the code with Eclipse 2. Run the class as a Java application.