mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
25 lines
425 B
Java
25 lines
425 B
Java
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Doo {
|
|
|
|
@NotNull
|
|
public String doSomething() {
|
|
String s = getSomeString();
|
|
if (s == null) {
|
|
throwSomeError();
|
|
}
|
|
return s;
|
|
}
|
|
|
|
private static void throwSomeError() {
|
|
throw new RuntimeException();
|
|
}
|
|
|
|
@Nullable
|
|
public String getSomeString() {
|
|
return Math.random() > 0.5 ? null : "Yeah";
|
|
}
|
|
|
|
}
|