mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
SurroundWithRequireNonNull testdata fixed after precise nullability reporting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user