mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-10 13:17:09 +07:00
nullity: check if possible to detect NotNull return value from conditional checks (IDEA-60693)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
class Test {
|
||||
@NotNull
|
||||
public String noNull( @Nullable String text) {
|
||||
return text == null ? "" : text;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -23,7 +23,7 @@ class Test {
|
||||
return ((String)str);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@NotNull
|
||||
String fram(@Nullable String str, boolean b) {
|
||||
if (str != null) {
|
||||
return b ? str : "not null strimg";
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Test {
|
||||
public String noNull( String text) {
|
||||
return text == null ? "" : text;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user