Compiler Prefs: 'assert' cannot be an identifier [message #146498] |
Mon, 20 October 2003 10:13 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: ah.wyona.com
Hi Eclipse team,
I just upgraded to 3.0-M4 and want to set 1.4 code compatibility
in the compiler preferences tab. But when I set "Source compatibility"
to "1.4", the dialog complains:
"When source compatibility is 1.4, 'assert' cannot be an identifier."
and won't let me click "OK".
Setting "Report 'assert' as identifier" to "ignore" doesn't help.
What am I doing wrong?
Thanks in advance!
-- Andreas
|
|
|
Re: Compiler Prefs: 'assert' cannot be an identifier [message #146582 is a reply to message #146498] |
Mon, 20 October 2003 14:32 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: ah.wyona.com
Andreas Hartmann wrote:
> Hi Eclipse team,
>
> I just upgraded to 3.0-M4 and want to set 1.4 code compatibility
> in the compiler preferences tab. But when I set "Source compatibility"
> to "1.4", the dialog complains:
>
> "When source compatibility is 1.4, 'assert' cannot be an identifier."
>
> and won't let me click "OK".
>
> Setting "Report 'assert' as identifier" to "ignore" doesn't help.
OK, I had to set it to "error". IMHO this is quite strange ...
Why isn't this option activated + disabled automatically?
-- Andreas
|
|
|
Re: Compiler Prefs: 'assert' cannot be an identifier [message #146602 is a reply to message #146582] |
Mon, 20 October 2003 14:53 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: olivier_thomann.ca.ibm.comNOSPAM
Le Mon, 20 Oct 2003 16:32:27 +0200, Andreas Hartmann <ah@wyona.com> a
écrit :
>OK, I had to set it to "error". IMHO this is quite strange ...
>Why isn't this option activated + disabled automatically?
You have two different settings.
1) Compiler compliance level:
When this is set to 1.4, Eclipse compiler "behaves" as javac 1.4. This
doesn't mean that assertion is enabled. By default javac 1.4 doesn't
enable the assertion support. You need to set the source level.
2) Source compatibility. This is equivalent to the -source option of
javac. So if you se -source 1.4 it doesn't make sense to report assert
as an identifier, because you enabled the assertion support and this
means that now "assert" is a keyword.
I would enter a bug against JDT/UI to set the three options once you
select the source compatibility to 1.4. The target (generated .class
file compatibility) should also be 1.4, because once the assertion are
enabled, the required JVM is 1.4 or above.
Hope this clarify a bit the compiler options.
Olivier
|
|
|
Powered by
FUDForum. Page generated in 0.03077 seconds