Files
openide/java/java-tests/testData/inspection/dataFlow/ancient/NullableProblemThroughCast.java

18 lines
375 B
Java

import org.jetbrains.annotations.Nullable;
class Npe {
void foo(@Nullable SomeInterface x) {
((SomeInterfaceImpl)x).<warning descr="Method invocation 'bar' may produce 'NullPointerException'">bar</warning>();
}
interface SomeInterface {
void bar();
}
class SomeInterfaceImpl implements SomeInterface {
@Override
public void bar() {
}
}
}