From 67f783a00fefedfa7b3f14f3159763b4bfe7f582 Mon Sep 17 00:00:00 2001 From: Tagir Valeev Date: Tue, 27 Nov 2018 17:30:20 +0700 Subject: [PATCH] SurroundWithRequireNonNull testdata fixed after precise nullability reporting --- .../surroundWithRequireNonNull/afterMethodArgument2.java | 8 ++++++-- .../surroundWithRequireNonNull/beforeMethodArgument2.java | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/afterMethodArgument2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/afterMethodArgument2.java index a460146b68ec..518d0dd1b6f3 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/afterMethodArgument2.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/afterMethodArgument2.java @@ -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; } } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/beforeMethodArgument2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/beforeMethodArgument2.java index b17be30ea19d..40c5b8884524 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/beforeMethodArgument2.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/surroundWithRequireNonNull/beforeMethodArgument2.java @@ -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 : "bar"); + foo(Math.random() > 0.5 ? get(1) : get(2)); + } + + static String get(int x) { + return x > 0 ? "foo" : null; } } \ No newline at end of file