nullity: check if possible to detect NotNull return value from conditional checks (IDEA-60693)

This commit is contained in:
anna
2010-11-11 14:17:57 +03:00
parent 0f0adb32b7
commit 76c393a145
5 changed files with 70 additions and 5 deletions
@@ -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;
}
}
@@ -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";
@@ -0,0 +1,5 @@
class Test {
public String noNull( String text) {
return text == null ? "" : text;
}
}