diff options
author | Stephan Herrmann | 2014-08-17 13:38:59 +0000 |
---|---|---|
committer | Stephan Herrmann | 2014-08-17 13:38:59 +0000 |
commit | 62012512b7f8c457e3722c4ee58656e0b57b87dd (patch) | |
tree | 9631708bd4b7981d4c9020e54b477eed76fb7abf /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java | |
parent | dc74cb9ccf05bc2089bda4773412bb0387d8bf2f (diff) | |
download | eclipse.jdt.core-62012512b7f8c457e3722c4ee58656e0b57b87dd.tar.gz eclipse.jdt.core-62012512b7f8c457e3722c4ee58656e0b57b87dd.tar.xz eclipse.jdt.core-62012512b7f8c457e3722c4ee58656e0b57b87dd.zip |
Bug 441208 - [1.8][null]SuppressWarnings("null") does not suppress /
marked Unnecessary
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java index ad645688e4..3688aa718b 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/NullAnnotationTest.java @@ -3001,6 +3001,47 @@ public void test_default_nullness_017() { "----------\n"); } +// package case +public void test_nullness_default_018() { + Map customOptions = getCompilerOptions(); + customOptions.put(JavaCore.COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, JavaCore.WARNING); + customOptions.put(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN, JavaCore.ERROR); + runConformTestWithLibs( + new String[] { + "pack/NullWarn.java", + "package pack;\n" + + "@SuppressWarnings(\"null\")\n" + + "public class NullWarn {\n" + + "\n" + + " // Some code\n" + + "\n" + + "}\n" + }, + customOptions, + ""); + +} + +// type case (inside default package) +public void test_nullness_default_018b() { + Map customOptions = getCompilerOptions(); + customOptions.put(JavaCore.COMPILER_PB_MISSING_NONNULL_BY_DEFAULT_ANNOTATION, JavaCore.WARNING); + customOptions.put(JavaCore.COMPILER_PB_UNUSED_WARNING_TOKEN, JavaCore.ERROR); + runConformTestWithLibs( + new String[] { + "NullWarn.java", + "@SuppressWarnings(\"null\")\n" + + "public class NullWarn {\n" + + "\n" + + " // Some code\n" + + "\n" + + "}\n" + }, + customOptions, + ""); + +} + // redundant default annotations - class vs. inner class public void test_redundant_annotation_01() { Map customOptions = getCompilerOptions(); |