This article is participating in “Java Theme Month – Java Debug Notes Event”, see < Event link > for more details.
Question: What is the list of valid @SuppressWarnings names in Java?
What is the list of valid warning names in @suppresswarningsJava?
Answer 1:
This depends on your IDE or compiler.
Here is a list of Eclipse Galileo:
- All: disables all warnings
- Boxing; To disallow the display of warnings related to packing/unpacking operations
- Cast: to cancel warnings related to projection operations
- Dep-ann: Suppress warnings against deprecated annotations
- Deprecation: to suppress deprecation-related warnings
- Fallthrough: to suppress warnings about missing interrupts in switch statements
- Finally Suppress a warning against final blocking that will not be blocked
- Hiding a local warning relative to a hidden variable
- Incomplete -switch: Disables display of warnings about missing entries in switch statements (enumeration case)
- NLS: Suppress warnings relative to non-NLS string literals
- Null: Disables the display of warnings about NULL analysis
- Restriction: Displays warnings about the use of references that are not recommended or prohibited
- Serial: Canceles warnings about missing serialVersionUID fields for serializable classes
- Static-access: To suppress warnings related to incorrect static access
- Synthetic -access: to suppress warnings related to unoptimized access from inner classes
- Unchecked to prohibit displaying warnings related to unchecked operations
- Undamp-field-access disallows the display of warnings about unqualified field access
- Unused: Disables the display of warnings about unused code
Other compilers are slightly different. You can find out for yourself.