diff options
author | Stephan Herrmann | 2018-04-22 09:56:28 +0000 |
---|---|---|
committer | Stephan Herrmann | 2018-04-22 09:56:28 +0000 |
commit | fe6ee572c0425cfff586def61b7a4e28809bd97e (patch) | |
tree | fc7126cdf69b60c1c78a1fd20c0423f34a9073e2 | |
parent | 2d379bebf74261e226f811f1c6c32d020c1a78b3 (diff) | |
download | eclipse.jdt.core-fe6ee572c0425cfff586def61b7a4e28809bd97e.tar.gz eclipse.jdt.core-fe6ee572c0425cfff586def61b7a4e28809bd97e.tar.xz eclipse.jdt.core-fe6ee572c0425cfff586def61b7a4e28809bd97e.zip |
Bug 533339 - incorrect Null type mismatch warning when using Guava's
checkNotNull, even with severity set to Ignore
- fix back-to-back testing w/ javac
Change-Id: Ie117ba425f75816181a8d61bcf7f699a4ba49ed7
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java index 4e6725bf70..00b4e3e243 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullTypeAnnotationTest.java @@ -17478,7 +17478,8 @@ public void testBug531040() { ); } public void testBug533339() { - runNegativeTestWithLibs( + Runner runner = new Runner(); + runner.testFiles = new String[] { "Test.java", "import org.eclipse.jdt.annotation.NonNull;\n" + @@ -17511,8 +17512,9 @@ public void testBug533339() { " return reference;\n" + " }\n" + "}\n" - }, - getCompilerOptions(), + }; + runner.classLibraries = this.LIBS; + runner.expectedCompilerLog = "----------\n" + "1. WARNING in Test.java (at line 19)\n" + " @NonNull String s = checkNotNull(foo.getString());\n" + @@ -17523,6 +17525,8 @@ public void testBug533339() { " return new Bar(checkNotNull(foo.getString()));// no warning when s is inlined\n" + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + "Null type safety (type annotations): The expression of type \'String\' needs unchecked conversion to conform to \'@NonNull String\'\n" + - "----------\n"); + "----------\n"; + runner.javacTestOptions = JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings; + runner.runWarningTest(); } } |