Bug 61260

Summary: classfile conformance options broken for assert
Product: [Eclipse Project] JDT Reporter: Jason Schroeder <shrode>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Jason Schroeder CLA 2004-05-06 13:15:58 EDT
Window>Preferences>Java>Compiler>Compliance and Classfiles

Outofthebox, "Compiler compliance level" is 1.4 but source files with assert
statements report errors.

But! when I specifically customize "Source compatibility" and "Generated .class
files compatibility" to 1.4 then the proper conformance behaviour happens.
Comment 1 Olivier Thomann CLA 2004-05-06 16:29:22 EDT
This works as designed. Compliance 1.4 means that the compiler "behaves" like
javac 1.4.
By default javac 1.4 doesn't compile assert statements. You need to specify
-source 1.4. This is done in Eclipse by changing the Source compatibility.
Because -source 1.4 means -target 1.4, in Eclipse you also need to change the
Generated .class
files compatibility to 1.4 and set assert as an identifier to Error.

Close as INVALID