Is there a way to ignore a single FindBugs warning?
问题 With PMD, if you want to ignore a specific warning, you can use // NOPMD to have that line be ignored. Is there something similar for FindBugs? 回答1: The FindBugs initial approach involves XML configuration files aka filters. This is really less convenient than the PMD solution but FindBugs works on bytecode, not on the source code, so comments are obviously not an option. Example: <Match> <Class name="com.mycompany.Foo" /> <Method name="bar" /> <Bug pattern="DLS_DEAD_STORE_OF_CLASS_LITERAL" /