mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-05 15:50:49 +07:00
To make error messages consistent #IDEA-374747 Fixed (cherry picked from commit 328c5b355fcf56a7d1c165aab32220d37bdfcbc1) IJ-MR-170004 GitOrigin-RevId: f00fb74ddbff84b18839c60648d664774d566966
23 lines
907 B
Java
23 lines
907 B
Java
import org.jetbrains.annotations.Contract;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
class Foo {
|
|
@Contract("<warning descr="Parameter 'f' is annotated as non-null, so '!null' is always satisfied">!null</warning>,true->!null")
|
|
String delegationToInstance(@NotNull Foo f, boolean createIfNeeded) {
|
|
return <warning descr="Return value of clause '!null, true -> !null' could be replaced with 'fail' as method always fails in this case">f.getString(createIfNeeded)</warning>;
|
|
}
|
|
|
|
@Contract("<warning descr="Parameter 'f' is annotated as non-null, so '!null' is always satisfied">!null</warning>,false->!null")
|
|
String delegationToInstanceOk(@NotNull Foo f, boolean createIfNeeded) {
|
|
return f.getString(createIfNeeded);
|
|
}
|
|
|
|
@Contract("true->fail")
|
|
String getString(boolean fail) {
|
|
if (fail) throw new RuntimeException();
|
|
return "a";
|
|
}
|
|
|
|
}
|