SurroundWithRequireNonNull testdata fixed after precise nullability reporting

This commit is contained in:
Tagir Valeev
2018-11-27 17:30:20 +07:00
parent ef669e0529
commit 67f783a00f
2 changed files with 12 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
// "Replace with 'Objects.requireNonNull(Math.random() > 0.5 ? null : "bar")'" "true"
// "Replace with 'Objects.requireNonNull(Math.random() > 0.5 ? get(1) : get(2))'" "true"
import java.util.List;
import java.util.Objects;
@@ -7,6 +7,10 @@ class MyClass {
void foo(String str) {}
void test() {
foo(Objects.requireNonNull(Math.random() > 0.5 ? null : "bar"));
foo(Objects.requireNonNull(Math.random() > 0.5 ? get(1) : get(2)));
}
static String get(int x) {
return x > 0 ? "foo" : null;
}
}

View File

@@ -1,4 +1,4 @@
// "Replace with 'Objects.requireNonNull(Math.random() > 0.5 ? null : "bar")'" "true"
// "Replace with 'Objects.requireNonNull(Math.random() > 0.5 ? get(1) : get(2))'" "true"
import java.util.List;
@@ -6,6 +6,10 @@ class MyClass {
void foo(String str) {}
void test() {
foo(Math.random() > 0.5 ? null :<caret> "bar");
foo(Math.random() > 0.5 ? get(1) :<caret> get(2));
}
static String get(int x) {
return x > 0 ? "foo" : null;
}
}