mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 02:15:59 +07:00
35 lines
1011 B
Java
35 lines
1011 B
Java
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Test {
|
|
private void test2(@NotNull Object bar) {}
|
|
|
|
void println(@Nullable Object o) {}
|
|
|
|
private Object test(Object foo, Object bar) {
|
|
if (foo == null) {
|
|
println(<warning descr="Value 'foo' is always 'null'"><caret>foo</warning>);
|
|
println(<warning descr="Value 'foo' is always 'null'">foo</warning>);
|
|
return <warning descr="Expression 'foo' might evaluate to null but is returned by the method which is not declared as @Nullable">foo</warning>;
|
|
}
|
|
if (bar == null) {
|
|
test2(<warning descr="Argument 'bar' might be null">bar</warning>);
|
|
}
|
|
return foo;
|
|
}
|
|
|
|
public void testDontReplaceQualifierWithNull(Object bar) {
|
|
if (bar == null) {
|
|
bar.<warning descr="Method invocation 'hashCode' may produce 'java.lang.NullPointerException'">hashCode</warning>();
|
|
}
|
|
}
|
|
|
|
void println(int i) {}
|
|
|
|
void testZero(int b) {
|
|
if (b == 0) {
|
|
println(b);
|
|
}
|
|
}
|
|
|
|
} |