mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-19 17:29:34 +07:00
14 lines
389 B
Java
14 lines
389 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Foo {
|
|
@Contract("null,_->true")
|
|
boolean bar(@Nullable Object foo, int i) {
|
|
if (foo == null) {
|
|
<warning descr="Contract clause 'null, _ -> true' is violated: exception might be thrown instead of returning true">throw new RuntimeException();</warning>
|
|
}
|
|
return i == 2;
|
|
}
|
|
|
|
}
|