Tuesday, April 06, 2010

Values of javac @SuppressWarnings

Legal values for the annotation @SuppressWarnings are compiler dependent, except unchecked, which is required by JLS.

I could find a listing for supported values in Eclipse IDE here. However, what is supported in Sun's (now Oracle) JDK is not well published. But, a little help from Sun JDK javac divulges the supported list as shown below:

[bjha@xxx]$ uname -rsp
Linux 2.6.13.5 x86_64

[bjha@xxx]$ javac -version
javac 1.6.0_07

[bjha@xxx]$ javac -X
...
-Xlint:{all,cast,deprecation,divzero,empty,unchecked,fallthrough,path,serial,finally,overrides,-cast,-deprecation,-divzero,-empty,-unchecked,-fallthrough,-path,-serial,-finally,-overrides,none}Enable or disable specific warnings
...
...
These options are non-standard and subject to change without notice.