Discover NullPointerException bugs using FindBug
- by alex2k8
When I run FindBug on this code, it reports NO issues.
boolean _closed = false;
public void m1(@Nullable String text) {
if(_closed)
return;
System.out.println(text.toLowerCase());
}
While here it finds issue as expected:
public void m1(@Nullable String text) {
System.out.println(text.toLowerCase()); // FireBug: text must be nonnull but is marked as nullable
}
Why does it fail in first case?