Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a class annotation in FindBugs to ignore all warning in a file

Tags:

findbugs

there is an annotation in FindBugs to ignore a set of errors, for instance:

import edu.umd.cs.findbugs.annotations.SuppressWarnings;
@SuppressWarnings(value="DLS_DEAD_LOCAL_STORE", justification="...")

is there a way to ignore all types of errors for a java file, using an annotation?

I am awared that a file can be excluded from the command line or a configuration file: http://findbugs.sourceforge.net/manual/filter.html

but for this particular case, I would need to define this exclusion modifying only that java file.

like image 530
David Portabella Avatar asked Nov 15 '12 13:11

David Portabella


1 Answers

Use the standard annotation with an empty string for the value attribute.

@SuppressWarnings(value = "")

If you use @SuppressFBWarnings instead of @SuppressWarnings to avoid the confusion with java.lang.SuppressWarnings and allow automatic importation in IDEs to work, you can even omit the value attribute entirely.

@SuppressFBWarnings
like image 155
David Harkness Avatar answered Sep 27 '22 16:09

David Harkness