Bug 319628 - Preferences->Java Compiler-> Errors/Warnings -> Unhandled token in '@SuppressWarnings'
Summary: Preferences->Java Compiler-> Errors/Warnings -> Unhandled token in '@Suppress...
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Ayushman Jain CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-12 15:46 EDT by Daniel Holmes CLA
Modified: 2010-12-07 00:06 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Holmes CLA 2010-07-12 15:46:19 EDT
Build Identifier: 

It would be nice for the usage of PMD tokens for this annotation would not be flagged by this check.  See this for how PMD defines to use this annotation.
http://pmd.sourceforge.net/suppressing.html


Reproducible: Always
Comment 1 Ayushman Jain CLA 2010-07-13 03:59:46 EDT
I'll investigate
Comment 2 Markus Keller CLA 2010-11-05 11:33:09 EDT
I don't think we should open the door here. We operate completely within the spec in java.lang.SuppressWarnings#value().

If PMD wants to use @SuppressWarnings although it is not a complete compiler, then you can just disable this warning in the Eclipse compiler (and maybe offer a replacement in PMD that considers more warning tokes as supported).
Comment 3 Daniel Holmes CLA 2010-11-05 13:34:20 EDT
I looked at the java spec and did not see the requirement that the values in this annotation were limited to a specific set.  In fact it seemed to indicate that the compiler would define its own set.  I guess I'm suggesting that an analysis tool like PMD that would utilize the common annotation for developer familiarity would have some level of compiler support, such as the compiler allowing additional string patterns that are not the compilers warning (like "PMD.*") to be used without that being an additional warning.

Our actual build compile uses the Sun/Oracle compiler and we do not get these warnings, but we get them in the eclipse environment.  To us, they are a false warning that we would like to globally suppress.
Comment 4 Markus Keller CLA 2010-11-08 05:38:52 EST
We won't make the set of supported warnings globally configurable. The PMD compiler doesn't have to be active for all Java projects in the workspace, so a global option would hide too many unhandled tokens.

To stop the JDT compiler from emitting this warning, you can call javaProject.setOption(JavaCore.COMPILER_PB_UNHANDLED_WARNING_TOKEN, JavaCore.IGNORE) on projects where you don't want it. That makes the JDT compiler behave like javac.
Comment 5 Srikanth Sankaran CLA 2010-12-07 00:06:23 EST
Verified for 3.7 M4