Bug 49404 - assert not available when compliance = 1.4
Summary: assert not available when compliance = 1.4
Status: RESOLVED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-29 17:11 EST by paul moore CLA
Modified: 2004-01-04 12:57 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paul moore CLA 2003-12-29 17:11:26 EST
in m6 (and m5) the use of 1.4 assert statement is rejected even though the 
installed compliance level is 1.4. (windows->preferences->Java->compiler-
>Compliance & classfiles)
In order to make it work you have to uncheck 'use default compliance settings', 
and explcitly select 1.4,1.4 and 'error'
Comment 1 Olivier Thomann CLA 2003-12-29 22:24:22 EST
This is not a bug. The compliance is simply a setting to comply with javac 1.4.
By default, javac 1.4 doesn't support the assertion. You have to enable it by
selecting 1.4 as the source level.
This is the same for Eclipse.
Ok to close?
Comment 2 paul moore CLA 2003-12-30 12:04:45 EST
in eclipse 2.0 the behavior was different - you just had to choose 1.4 from 
this combo.
I guess if its 'by design' then OK. But its incredibly confusing (I see another 
bug complaining about this too). The fact that OOB you have to change 4 
settings to make assert work seems excessive.
Comment 3 Philipe Mulet CLA 2004-01-04 12:57:01 EST
In 2.0, our settings were more convenient, but slightly inconsistent with other 
command line compilers. By default, 1.4 compilers do not enable assertions, you 
have to explicitly set the source level to 1.4.

We now match expectation, though it is not as convenient as in the past.