mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 02:15:59 +07:00
17 lines
408 B
Java
17 lines
408 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Foo {
|
|
@Contract("null->false")
|
|
boolean plainDelegation(Object x) {
|
|
return <warning descr="Contract clause 'null -> false' is violated">bar(2, x)</warning>;
|
|
}
|
|
|
|
@Contract("_,null->true")
|
|
boolean bar(int i, @Nullable Object foo) {
|
|
return foo == null;
|
|
}
|
|
|
|
}
|