public class FpS2259 {
public void test() {
Foo foo = new Foo();
boolean fooCalled = false;
Bar bar;
try {
bar = new Bar();
foo.foo();
fooCalled = true;
} finally {
if (!fooCalled) {
foo.foo();
}
}
bar.bar(); // <------- reported violation: NullPointerException might be thrown as 'bar' is nullable here
}
private static class Foo {
public void foo() {}
}
private static class Bar {
public void bar() {}
}
}
--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/4752a999-246e-42c2-bbdc-8a44a5564ce9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.