mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
32 lines
787 B
Java
32 lines
787 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Doo {
|
|
|
|
@Nullable
|
|
Object getMethod() {return null;}
|
|
|
|
boolean isSomething() { return false;}
|
|
|
|
@Contract(pure=true)
|
|
boolean pureSomething() { return false;}
|
|
|
|
public void main2() {
|
|
if (getMethod() == null && !isSomething()) {
|
|
return;
|
|
} else {
|
|
System.out.println(getMethod().<warning descr="Method invocation 'hashCode' may produce 'java.lang.NullPointerException'">hashCode</warning>());
|
|
}
|
|
}
|
|
|
|
public void main3() {
|
|
if (getMethod() == null && !pureSomething()) {
|
|
return;
|
|
} else {
|
|
System.out.println(getMethod().<warning descr="Method invocation 'hashCode' may produce 'java.lang.NullPointerException'">hashCode</warning>());
|
|
}
|
|
}
|
|
|
|
}
|
|
|