diff options
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java | 90 |
1 files changed, 89 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java index e4a5ff589..17c799e36 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java @@ -45,7 +45,7 @@ public class AnnotationTest extends AbstractComparableTest { // All specified tests which do not belong to the class are skipped... static { // TESTS_NAMES = new String[] { "test127" }; -// TESTS_NUMBERS = new int[] { 286 }; +// TESTS_NUMBERS = new int[] { 289 }; // TESTS_RANGE = new int[] { 249, -1 }; } @@ -9518,4 +9518,92 @@ public void test286() { raiseDeprecationReduceInvalidJavadocSeverity, null); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=311849 +public void test287() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR); + options.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); + this.runConformTest( + new String[] { + "X.java", + "import java.util.ArrayList;\n" + + "\n" + + "public class X {\n" + + " @SuppressWarnings(\"rawtypes\")\n" + + " void foo(ArrayList arg) {\n" + + " for (\n" + + " @SuppressWarnings(\"unchecked\")\n" + + " boolean a= arg.add(1), b= arg.add(1);\n" + + " Boolean.FALSE;\n" + + " ) {\n" + + " System.out.println(a && b);\n" + + " }\n" + + " }\n" + + "}", + }, + "", + null, + true, + null, + options, + null); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=311849 +public void test288() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR); + options.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); + this.runConformTest( + new String[] { + "X.java", + "import java.util.ArrayList;\n" + + "\n" + + "public class X {\n" + + " @SuppressWarnings(\"rawtypes\")\n" + + " ArrayList arg;\n" + + " @SuppressWarnings(\"unchecked\")\n" + + " boolean a= arg.add(1), b= arg.add(1);\n" + + "}", + }, + "", + null, + true, + null, + options, + null); +} +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=311849 +public void test289() { + Map options = getCompilerOptions(); + options.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR); + options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE); + options.put(CompilerOptions.OPTION_SuppressOptionalErrors, CompilerOptions.ENABLED); + this.runConformTest( + new String[] { + "X.java", + "import java.util.ArrayList;\n" + + "\n" + + "public class X {\n" + + " void foo(ArrayList arg) {\n" + + " for (\n" + + " @Deprecated\n" + + " @Other\n" + + " @SuppressWarnings(\"unchecked\")\n" + + " boolean a= arg.add(1), b= arg.add(1);\n" + + " Boolean.FALSE;\n" + + " ) {\n" + + " System.out.println(a && b);\n" + + " }\n" + + " }\n" + + "}", + "Other.java", + "@interface Other {}" + }, + "", + null, + true, + null, + options, + null); +} } |