private void notFoundIfNull(Object o) {
if (o == null) {
throw new NotFoundException();
}
}
public int run(Object o) {
notFoundIfNull(o);
return o.getIndex(); // <-- NullPointerException might be thrown as 'o' is nullable here
}
有没有办法让SonarQube明白o
在这里不能为空,否则会抛出NotFoundException
?
SonarJava v4.9.0.9858