Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356018 - VerifyError: Stack map does not match the one at exception handler.
Summary: VerifyError: Stack map does not match the one at exception handler.
Status: VERIFIED DUPLICATE of bug 353535
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-28 06:10 EDT by Tadas CLA
Modified: 2011-09-05 06:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tadas CLA 2011-08-28 06:10:27 EDT
Build Identifier: 20110818-2043

Eclipse's default incremental compiler generates invalid bytecode when using 1.7 source and 1.7 target compliance. Default & only Installed JRE in eclipse is jdk1.7.0. Path contains JDK7 binaries, as can be seen:
java -server -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)

The error that occurs is:
Exception in thread "main" java.lang.VerifyError: Stack map does not match the one at exception handler 74 in method Conformance.main([Ljava/lang/String;)V at offset 4
	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)

This error does not occur if compiled using javac.
This error does not occur if changed to:
String line = null;

Reproducible: Always

Steps to Reproduce:
Bad bytecode is generated for:

String line;
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
	while ((line = br.readLine()) != null)
		if ("exit".equals(line))
			break;
} catch (Exception e) {
	// do anything or nothing
}
Comment 1 Olivier Thomann CLA 2011-08-28 19:11:08 EDT
Seems to be a dup of bug 353535.
Could you please try with 3.7.1RC2?
Comment 2 Olivier Thomann CLA 2011-08-29 12:34:07 EDT
Closing as a duplicate of bug 353535.

*** This bug has been marked as a duplicate of bug 353535 ***
Comment 3 Jay Arthanareeswaran CLA 2011-09-05 06:27:39 EDT
Verified for 3.7.1 with build M20110831-1030.