Files
openide/java/java-tests/testData/inspection/dataFlow/fixture/ThrowNullable.java
T

18 lines
509 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) {
}
}
}