Bug 98091 - [1.5][compiler] @SuppressWarnings("assertIdentifier") cannot be applied
Summary: [1.5][compiler] @SuppressWarnings("assertIdentifier") cannot be applied
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-02 08:53 EDT by Frederic Fusier CLA
Modified: 2005-06-10 10:05 EDT (History)
1 user (show)

See Also:


Attachments
Apply on HEAD (1.20 KB, patch)
2005-06-03 09:57 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2005-06-02 08:53:20 EDT
Using 3.1 RC1.

Identifiers called "assert" are flagged as warning only in 1.3 or 1.4 source
levels and annotations cannot be used at these source levels.

At 1.5 source level such identifiers are flagged as error and so cannot be
suppressed using SuppressWarnings annotation...
Comment 1 Philipe Mulet CLA 2005-06-02 10:54:56 EDT
It should be handled specifically for @SuppressWarnings. It need to remain found
as an irritant for rest of problem reporting to function properly.

+1 for RC2
Comment 2 Olivier Thomann CLA 2005-06-02 11:05:03 EDT
So you mean that you want to remove the support for "assert" inside the
@SuppressWarnings support.
Comment 3 Olivier Thomann CLA 2005-06-03 09:51:03 EDT
"assert" should indeed be removed from the list of valid tokens for
@SuppressWarnings as this has to be an error in 1.5 code. Therefore it can never
be flagged as a warning.
Comment 4 Olivier Thomann CLA 2005-06-03 09:57:12 EDT
Created attachment 22319 [details]
Apply on HEAD

Proposed patch
Comment 5 Olivier Thomann CLA 2005-06-03 10:08:54 EDT
Fixed and released in HEAD.
Regression test added in
org.eclipse.jdt.core.tests.model.CodeCorrectionTests.testWarningAssert.
Comment 6 Olivier Thomann CLA 2005-06-03 10:13:42 EDT
Also added regression test in
org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest.test150
Comment 7 Frederic Fusier CLA 2005-06-07 12:14:20 EDT
Verified for 3.1 RC2 using build N20050607-0010 + JDT/Core HEAD
Comment 8 David Audel CLA 2005-06-10 10:05:47 EDT
Verified for 3.1 RC2 using build I20050610-0010