mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 09:47:51 +07:00
Attempt to fix IDEA-336371 False Negative NPE after instanceof check GitOrigin-RevId: 1539e33119f58bcd58f20d9015b7c8092d79d02b
22 lines
470 B
Java
22 lines
470 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
final class NullFP {
|
|
void test(@NotNull Y y) {}
|
|
|
|
interface X {
|
|
@Contract(pure = true)
|
|
@Nullable Y getY();
|
|
}
|
|
|
|
interface Y {}
|
|
interface Z extends Y {}
|
|
|
|
void run(@NotNull final X x) {
|
|
final Y y = x.getY();
|
|
if (y instanceof Z) {}
|
|
test(<warning descr="Argument 'x.getY()' might be null">x.getY()</warning>);
|
|
}
|
|
}
|