Bug 98091

Summary: [1.5][compiler] @SuppressWarnings("assertIdentifier") cannot be applied
Product: [Eclipse Project] JDT Reporter: Frederic Fusier <frederic_fusier>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.1   
Target Milestone: 3.1 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Apply on HEAD none

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