There are a lot of warnings during the Java compilation process, many of which are secure, but there are a lot of warnings for each compilation that affect our filtering and modification of error, and we can add
@SuppressWarnings ("XXXX") to resolve
For example: @SuppressWarnings ("deprecation") indicates that a warning is not displayed when a class or method is used that is deprecated
Specific xxxx meaning can refer to the blog
http://www.thebuzzmedia.com/supported-values-for-suppresswarnings/
Update #1: All These annotations is still valid in Eclipse 3.4 and 3.5, there has been no new Suppresswarni Ng arguments added in those versions of the JDT compiler.
If you is a Java developer and use the new @SuppressWarnings annotation in your code from Time-to-time to suppress Compil Er warnings you, like me, has wondered probably about a million times alreadyjust exactly what is the supported values that can is used with this annotation.
The reason the list isn ' t easy-to-find is because it's compiler specific, which means Sun may has a different set of supp Orted values than say IBM, GCJ or Apache Harmony.
Fortunately for us, the eclipse folks has documented the values they support (as of Eclipse 3.3), here they is For reference:
- All to suppress all warnings
- boxing to suppress warnings relative to boxing/unboxing operations
- cast to suppress warnings relative to cast operations
- Dep-ann to suppress warnings relative to deprecated annotation
- deprecation to suppress warnings relative to deprecation
- Fallthrough to suppress warnings relative to missing breaks in switch statements
- finally to suppress warnings relative-finally block that don ' t return
- hiding to suppress warnings relative to locals that hide variable
- Incomplete-switch to suppress warnings relative to missing entries in a switch statement (enum case)
- NLS to suppress warnings relative to non-nls string literals
- null to suppress warnings relative-to-null analysis
- rawtypes to suppress warnings relative to un-specific types when using generics on class params
- restriction to suppress warnings relative to usage of discouraged or forbidden references
- serial to suppress warnings relative to missing serialversionuid field for a serializable class
- static-access to suppress warnings relative to incorrect static access
- synthetic-access to suppress warnings relative to unoptimized access from inner classes
- unchecked to suppress warnings relative to unchecked operations
- unqualified-field-access to suppress warnings relative to field access unqualified
- unused to suppress warnings relative to unused code
javase:suppresswarnings[Turn]