mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-07 22:00:39 +07:00
Use DFA where possible. Fixes IDEA-287718 A way for batch add `@Nonnull` annotation for methods, which IDEA infer as nonnull GitOrigin-RevId: 4c8c7fb3f790648ef85a2dfed6111a3b4c50c13b
37 lines
574 B
Java
37 lines
574 B
Java
import org.jetbrains.annotations.*;
|
|
|
|
class Test {
|
|
void bar(@Nullable String str) {
|
|
if (str == null) {
|
|
foo(str);
|
|
}
|
|
}
|
|
|
|
String foo(String str) {
|
|
return str;
|
|
}
|
|
|
|
@NotNull
|
|
String foo1(@Nullable String str) {
|
|
if (str == null) return "null";
|
|
return (str);
|
|
}
|
|
|
|
@NotNull
|
|
String foo2(@Nullable String str) {
|
|
if (str == null) return "null";
|
|
return ((String)str);
|
|
}
|
|
|
|
@NotNull
|
|
String fram(@Nullable String str, boolean b) {
|
|
if (str != null) {
|
|
return b ? str : "not null strimg";
|
|
}
|
|
return "str was null";
|
|
}
|
|
|
|
|
|
|
|
|
|
} |