FindBugs 似乎只显示每种方法中特定错误的第一次出现。这发生在 Eclipse 以及 FindBugs 独立客户端中。
如何配置 FindBugs 以显示所有事件?
例子:
import javax.annotation.Nonnull;
public class Bar
{
public void meth(@Nonnull final String pArg) {
System.out.println(pArg);
}
public void foo() {
String s = null;
meth(s); // <<== bug marker here (NP_NONNULL_PARAM_VIOLATION)
meth(null); // no bug marker here
meth(s); // and none here either :-(
}
}
我正在使用最新的 FindBugs 2.0.2 Eclipse 插件(带有 Eclipse 3.6)。
该问题似乎取决于错误模式。例如,我看到每个方法不止一次命中DLS_DEAD_LOCAL_STORE
,但没有NP_NONNULL_PARAM_VIOLATION
。后者如上图所示。
谢谢!