mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 07:57:19 +07:00
GitOrigin-RevId: 7247332e3e0aba95116cb4d84696c00cfa20ba45
27 lines
772 B
Java
27 lines
772 B
Java
import static javax.annotation.meta.When.MAYBE;
|
|
|
|
import javax.annotation.CheckForNull;
|
|
import javax.annotation.Nonnull;
|
|
import javax.annotation.meta.TypeQualifierNickname;
|
|
|
|
class Main {
|
|
int go(Lib lib) {
|
|
return lib.usingNonnullMaybe().<warning descr="Method invocation 'hashCode' may produce 'NullPointerException'">hashCode</warning>() + lib.usingCheckForNull().<warning descr="Method invocation 'hashCode' may produce 'NullPointerException'">hashCode</warning>();
|
|
}
|
|
|
|
interface Lib {
|
|
@UsingNonnullMaybe
|
|
Object usingNonnullMaybe();
|
|
|
|
@UsingCheckForNull
|
|
Object usingCheckForNull();
|
|
}
|
|
|
|
@Nonnull(when = MAYBE)
|
|
@TypeQualifierNickname
|
|
@interface UsingNonnullMaybe {}
|
|
|
|
@CheckForNull
|
|
@TypeQualifierNickname
|
|
@interface UsingCheckForNull {}
|
|
} |