Community
Participate
Working Groups
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'
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?
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.
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.