mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-20 02:15:59 +07:00
18 lines
438 B
Java
18 lines
438 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Foo {
|
|
|
|
@Contract(value = "_, true -> !null")
|
|
public @Nullable String noNotAllowed(@NotNull String bar, boolean reallyNotAllowed) {
|
|
if (bar.equals("no")) {
|
|
if (reallyNotAllowed) {
|
|
throw new IllegalArgumentException("heck no");
|
|
}
|
|
return null;
|
|
}
|
|
return bar;
|
|
}
|
|
}
|