A DESCRIPTION OF THE REQUEST :
I have a lot of generated code from javacc in my project, that one compiled produces hundreds of warnings. This is infuriating because I have little to no control of the code that is generated and cannot remove the warnings. It would be nice if the SuppressWarnings annotation could be applied to the package specified in the package-info.java file. SuppressWarnings can be applied to pretty much everything else except for packages, so I feel this is an omission.
Example contents of package-info.java:
@SuppressWarnings("all")
package some.package.with.lots.of.warnings;
JUSTIFICATION :
It would mean I can differenciate warnings in my own code from warnings in generated code much easier.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
SuppressWarnings should work exactly like it does when used elsewhere except that the scope of the warning supression should be the entire package.
ACTUAL -
As it stands, SuppressWarnings cannot be applied to a package and the compile will fail.
---------- BEGIN SOURCE ----------
Contents of package-info.java:
@SuppressWarnings("all")
package some.package.i.have.no.control.over.that.generates.loads.of.warnings;
Currently this code will not compile, as there is no target that allows the annotation to be applied to a package.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
There is no workaround.
###@###.### 2005-07-21 09:41:35 GMT