I tried annotating the enclosing method with
@SuppressWarnings("compareIdentical")
but this does not work (worse yet, the annotation results in its own Unsupported @SuppressWarnings("compareIdentical") warning!)
I know that I can always use
@SuppressWarnings("all")
but that’d be more warning-suppression than I want.
FWIW, I got the “compareIdentical” string from the “Warning Options” table in http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.jdt.doc.isv/guide/jdt_api_compile.htm (a hail-mary pass, to be sure).
Thanks!
Advertisement
Answer
Officially, there are only 3 supported arguments to @SuppressWarnings(), as specified by the standard $9.6.4.5:
- Unchecked warnings (§4.8, §5.1.6, §5.1.9, §8.4.1, §8.4.8.3, §15.12.4.2, §15.13.2, §15.27.3) are specified by the string
"unchecked".- Deprecation warnings (§9.6.4.6) are specified by the string
"deprecation".- Removal warnings (§9.6.4.6) are specified by the string
"removal".
But, in small text, the standard mentions support for extra types:
For other kinds of warnings, compiler vendors should document the strings they support for
@SuppressWarnings. Vendors are encouraged to cooperate to ensure that the same names work across multiple compilers.
These are supported by some compilers:
allto suppress all warningsboxingto suppress warnings relative to boxing/unboxing operationscastto suppress warnings relative to cast operationsdep-annto suppress warnings relative to deprecated annotationdeprecationto suppress warnings relative to deprecationfallthroughto suppress warnings relative to missing breaks in switch statementsfinallyto suppress warnings relative to finally block that don’t returnhidingto suppress warnings relative to locals that hide variableincomplete-switchto suppress warnings relative to missing entries in a switch statement (enum case)nlsto suppress warnings relative to non-nls string literalsnullto suppress warnings relative to null analysisrawto suppress warnings relative to usage of raw typesrestrictionto suppress warnings relative to usage of discouraged or forbidden referencesserialto suppress warnings relative to missing serialVersionUID field for a serializable classstatic-accessto suppress warnings relative to incorrect static accesssuperto suppress warnings relative to overriding a method without super invocationssynthetic-accessto suppress warnings relative to unoptimized access from inner classesuncheckedto suppress warnings relative to unchecked operationsunqualified-field-accessto suppress warnings relative to field access unqualifiedunusedto suppress warnings relative to unused code and dead code
So, there is nothing which might help you.