Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/ThrowNullable.java
T
peter 3849e3c228 dfa: fix false positive when throwing parameter
remove complicated code that the tests pass without
2017-03-08 16:02:36 +01:00

22 lines
562 B
Java

class DataFlowBug {
void foo() {
RuntimeException o = System.nanoTime() % 2 == 0 ? null : new RuntimeException();
throw <warning descr="Dereference of 'o' may produce 'java.lang.NullPointerException'">o</warning>;
}
void foo2() {
try {
RuntimeException o = System.nanoTime() % 2 == 0 ? null : new RuntimeException();
throw <warning descr="Dereference of 'o' may produce 'java.lang.NullPointerException'">o</warning>;
}
catch (RuntimeException exception) {
}
}
void foo(RuntimeException tt) {
throw tt;
}
}