blob: a1d263f778f66219bf25c08bdd867ccbf0cb5bdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import org.jetbrains.annotations.Nullable;
class Doo {
boolean isMaybeNotNull(@Nullable Object o) {
return o != null;
}
void foo(@Nullable String s) {
if (isMaybeNotNull(s)) {
System.out.println(<warning descr="Method invocation 's.length()' may produce 'java.lang.NullPointerException'">s.length()</warning>);
}
}
}
class DooImpl extends Doo {
boolean isMaybeNotNull(@Nullable Object o) {
return hashCode() == 42;
}
}
|