Hi Andreas,

> Is it possible to tell Findbugs and/or PMD to ignore specific false
> positives using annotations (either Javadoc style or Java 5)?
Sorry, I completely forgot to answer this question. In addition to specifying a 
specific ruleset it is possible to deactivate a rule in a specific context. 
This should be accompanied with a comment, of course.

As PMD works on the source code it is possible to use the normal 
@SuppressWarnings annotation in the following format
@SuppressWarnings("PMD.rulename")

If you are working with Eclipse, you then have to ignore a warning of an 
unknown suppression, or something like that (Eclipse compiler setting).
PMD recognizes this suppression.

Also see: 
http://pmd.sourceforge.net/suppressing.html


For Findbugs this can obviously not work, as Findbugs operates on the bytecode 
and the java.lang.SuppressWarnings annotation has source not runtime rentention.
Therefore Findbugs defines its own Annotation:
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value="rulename")

Also see:
http://findbugs.sourceforge.net/manual/annotations.html


Regards,
  Eric

Reply via email to