### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java,v retrieving revision 1.189 diff -u -r1.189 AnnotationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 3 Nov 2008 10:15:49 -0000 1.189 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 5 Nov 2008 10:49:44 -0000 @@ -3874,7 +3874,7 @@ " void foo(List list) {\n" + " List ls1 = list;\n" + " }\n" + - " @SuppressWarnings(\"unchecked\")\n" + + " @SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + " void bar(List list) {\n" + " List ls2 = list;\n" + " }\n" + @@ -4053,7 +4053,8 @@ "@SuppressWarnings( { \"deprecation\",//$NON-NLS-1$\n" + " \"finally\",//$NON-NLS-1$\n" + " \"serial\",//$NON-NLS-1$\n" + - " \"unchecked\"//$NON-NLS-1$\n" + + " \"unchecked\",//$NON-NLS-1$\n" + + " \"rawtypes\"//$NON-NLS-1$\n" + "})\n" + "public class X {\n" + " public static void main(String[] args) {\n" + @@ -4081,7 +4082,7 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 23)\n" + + "1. ERROR in X.java (at line 24)\n" + " Zork dummy;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -4099,7 +4100,8 @@ "public class X {\n" + " @SuppressWarnings( { \"deprecation\",//$NON-NLS-1$\n" + " \"finally\",//$NON-NLS-1$\n" + - " \"unchecked\"//$NON-NLS-1$\n" + + " \"unchecked\",//$NON-NLS-1$\n" + + " \"rawtypes\"//$NON-NLS-1$\n" + " })\n" + " public static void main(String[] args) {\n" + " W.deprecated();\n" + @@ -4112,7 +4114,7 @@ " }\n" + " }\n" + "\n" + - " @SuppressWarnings(\"unchecked\"//$NON-NLS-1$\n" + + " @SuppressWarnings({\"unchecked\",\"rawtypes\"}//$NON-NLS-1$//$NON-NLS-2$\n" + " )\n" + " List l = new Vector();\n" + "\n" + @@ -4132,7 +4134,7 @@ "}\n" }, "----------\n" + - "1. ERROR in X.java (at line 28)\n" + + "1. ERROR in X.java (at line 29)\n" + " Zork dummy;\n" + " ^^^^\n" + "Zork cannot be resolved to a type\n" + @@ -5037,7 +5039,7 @@ this.runNegativeTest( new String[] { "X.java", - "@SuppressWarnings(\"unchecked\")\n" + + "@SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + "public class X {\n" + " \n" + " public static void main(String[] args) {\n" + @@ -8663,4 +8665,31 @@ options, null); } +//https://bugs.eclipse.org/bugs/show_bug.cgi?id=163093 +public void test264() { + this.runNegativeTest( + new String[] { + "X.java", + "interface Adaptable {\n" + + " public Object getAdapter(Class clazz); \n" + + "}\n" + + "\n" + + "public class X implements Adaptable {\n" + + " public Object getAdapter(@SuppressWarnings(\"rawtypes\") Class clazz) {\n" + + " return zork;\n" + + " }\n" + + "}\n" + }, + "----------\n" + + "1. WARNING in X.java (at line 2)\n" + + " public Object getAdapter(Class clazz); \n" + + " ^^^^^\n" + + "Class is a raw type. References to generic type Class should be parameterized\n" + + "----------\n" + + "2. ERROR in X.java (at line 7)\n" + + " return zork;\n" + + " ^^^^\n" + + "zork cannot be resolved\n" + + "----------\n"); +} } Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v retrieving revision 1.762 diff -u -r1.762 GenericTypeTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 4 Nov 2008 10:04:51 -0000 1.762 +++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 5 Nov 2008 10:49:50 -0000 @@ -7225,7 +7225,7 @@ "import java.util.HashMap;\n" + "import java.util.Map;\n" + "public class X {\n" + - " @SuppressWarnings(\"unchecked\")\n" + + " @SuppressWarnings(\"rawtypes\")\n" + " private static final Map classes = new HashMap();\n" + " public static void main(String[] args) throws Exception {\n" + " classes.put(\"test\", X.class);\n" + @@ -33682,7 +33682,7 @@ "ComparableComparator.java", "import java.util.Comparator;\n" + "\n" + - "@SuppressWarnings(\"unchecked\")\n" + + "@SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + "class ComparableComparator> implements Comparator {\n" + "\n" + " static ComparableComparator instance = new ComparableComparator();\n" + @@ -33701,7 +33701,7 @@ "}\n" + "}\n" + "\n" + - "@SuppressWarnings(\"unchecked\")\n" + + "@SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + "class ComparatorUtils {\n" + "\n" + " static Comparator BAR = ComparableComparator.bar();//0\n" + @@ -33720,7 +33720,7 @@ "}\n" + "}\n" + "\n" + - "@SuppressWarnings(\"unchecked\")\n" + + "@SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + "class NullComparator implements Comparator {\n" + "\n" + " Comparator nonNullComparator;\n" + @@ -42142,7 +42142,7 @@ "X.java", "public class X {\n" + " Zork z;\n" + - " @SuppressWarnings(\"unchecked\")\n" + + " @SuppressWarnings({\"unchecked\",\"rawtypes\"})\n" + " public B getB() {\n" + " return new B();\n" + " }\n" + #P org.eclipse.jdt.core Index: compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java,v retrieving revision 1.2 diff -u -r1.2 IrritantSet.java --- compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 3 Oct 2008 08:39:30 -0000 1.2 +++ compiler/org/eclipse/jdt/internal/compiler/impl/IrritantSet.java 5 Nov 2008 10:49:52 -0000 @@ -51,36 +51,32 @@ public static final IrritantSet FINALLY = new IrritantSet( CompilerOptions.FinallyBlockNotCompleting); public static final IrritantSet HIDING = new IrritantSet( - CompilerOptions.MaskedCatchBlock); // further scenarii in static - // initializer + CompilerOptions.MaskedCatchBlock); // further scenarii in static initializer public static final IrritantSet INCOMPLETE_SWITCH = new IrritantSet( CompilerOptions.IncompleteEnumSwitch); public static final IrritantSet NLS = new IrritantSet( CompilerOptions.NonExternalizedString); public static final IrritantSet NULL = new IrritantSet( - CompilerOptions.NullReference); // further scenarii in static - // initializer + CompilerOptions.NullReference); // further scenarii in static initializer public static final IrritantSet RESTRICTION = new IrritantSet( - CompilerOptions.ForbiddenReference); // further scenarii in static - // initializer + CompilerOptions.ForbiddenReference); // further scenarii in static initializer public static final IrritantSet SERIAL = new IrritantSet( CompilerOptions.MissingSerialVersion); public static final IrritantSet STATIC_ACCESS = new IrritantSet( - CompilerOptions.IndirectStaticAccess); // further scenarii in static - // initializer + CompilerOptions.IndirectStaticAccess); // further scenarii in static initializer public static final IrritantSet SYNTHETIC_ACCESS = new IrritantSet( CompilerOptions.AccessEmulation); public static final IrritantSet SUPER = new IrritantSet( CompilerOptions.OverridingMethodWithoutSuperInvocation); public static final IrritantSet UNUSED = new IrritantSet( - CompilerOptions.UnusedLocalVariable); // further scenarii in static - // initializer + CompilerOptions.UnusedLocalVariable); // further scenarii in static initializer public static final IrritantSet UNCHECKED = new IrritantSet( - CompilerOptions.UncheckedTypeOperation); // further scenarii in - // static initializer + CompilerOptions.UncheckedTypeOperation); public static final IrritantSet UNQUALIFIED_FIELD_ACCESS = new IrritantSet( CompilerOptions.UnqualifiedFieldAccess); - + public static final IrritantSet RAW = new IrritantSet( + CompilerOptions.RawTypeReference); + public static final IrritantSet COMPILER_DEFAULT_ERRORS = new IrritantSet(0); // no optional error by default public static final IrritantSet COMPILER_DEFAULT_WARNINGS = new IrritantSet(0); // see static initializer below static { @@ -139,7 +135,6 @@ .set(CompilerOptions.UnusedImport) .set(CompilerOptions.UnusedTypeArguments) .set(CompilerOptions.RedundantSuperinterface); - UNCHECKED.set(CompilerOptions.RawTypeReference); } // Internal state Index: compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java,v retrieving revision 1.209 diff -u -r1.209 CompilerOptions.java --- compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 10 Oct 2008 17:24:31 -0000 1.209 +++ compiler/org/eclipse/jdt/internal/compiler/impl/CompilerOptions.java 5 Nov 2008 10:49:52 -0000 @@ -341,6 +341,7 @@ "incomplete-switch", //$NON-NLS-1$ "nls", //$NON-NLS-1$ "null", //$NON-NLS-1$ + "rawtypes", //$NON-NLS-1$ "restriction", //$NON-NLS-1$ "serial", //$NON-NLS-1$ "static-access", //$NON-NLS-1$ @@ -679,7 +680,7 @@ case MissingDeprecatedAnnotation : return "dep-ann"; //$NON-NLS-1$ case RawTypeReference : - return "unchecked"; //$NON-NLS-1$ + return "rawtypes"; //$NON-NLS-1$ case UnusedLabel : case UnusedTypeArguments : case RedundantSuperinterface : @@ -742,6 +743,8 @@ return IrritantSet.NULL; break; case 'r' : + if ("rawtypes".equals(warningToken)) //$NON-NLS-1$ + return IrritantSet.RAW; if ("restriction".equals(warningToken)) //$NON-NLS-1$ return IrritantSet.RESTRICTION; break; #P org.eclipse.jdt.core.tests.model Index: workspace/Converter15/src/test0185/X.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/workspace/Converter15/src/test0185/X.java,v retrieving revision 1.1 diff -u -r1.1 X.java --- workspace/Converter15/src/test0185/X.java 2 Jun 2005 16:51:43 -0000 1.1 +++ workspace/Converter15/src/test0185/X.java 5 Nov 2008 10:49:55 -0000 @@ -3,7 +3,7 @@ import java.util.ArrayList; import java.util.List; -@SuppressWarnings("unchecked") +@SuppressWarnings({"unchecked","rawtypes"}) public class X { List ls = new ArrayList(); } \ No newline at end of file Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v retrieving revision 1.279 diff -u -r1.279 ASTConverter15Test.java --- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 4 Nov 2008 10:04:56 -0000 1.279 +++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 5 Nov 2008 10:49:55 -0000 @@ -7307,7 +7307,7 @@ "import java.util.Collection;\n" + "public class X {\n" + " public static List bar;\n" + - " @SuppressWarnings(\"unchecked\")\n" + + " @SuppressWarnings(\"rawtypes\")\n" + " public static Collection bar2;\n" + "}"; this.workingCopy.getBuffer().setContents(contents);