### 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.183.2.2 diff -u -r1.183.2.2 AnnotationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 23 Oct 2008 07:14:39 -0000 1.183.2.2 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 23 Jan 2009 06:25:57 -0000 @@ -70,6 +70,37 @@ reportMissingJavadocComments = null; } + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=261323. + // Test to make sure that the use of a static import as an annotation value counts as a use + // (and consequently that there is no unused static import warning) + public void test261323() { + Map customOptions = getCompilerOptions(); + + customOptions.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR); + customOptions.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.ENABLED); + customOptions.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR); + + runNegativeTest( + true, + new String[] { + "com/SomeTest.java", + "package com;\n" + + "import static com.SomeTest.UNCHECKED;\n" + + "@SuppressWarnings(UNCHECKED)\n" + + "public class SomeTest {\n" + + " public static final String UNCHECKED = \"unchecked\";\n" + + "}\n" + }, + null, customOptions, + "----------\n" + + "1. ERROR in com\\SomeTest.java (at line 3)\n" + + " @SuppressWarnings(UNCHECKED)\n" + + " ^^^^^^^^^\n" + + "Unnecessary @SuppressWarnings(\"unchecked\")\n" + + "----------\n", + JavacTestOptions.Excuse.EclipseWarningConfiguredAsError); + } + public void test001() { this.runConformTest( new String[] {