### 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.192 diff -u -r1.192 AnnotationTest.java --- src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 15 Jan 2009 18:13:56 -0000 1.192 +++ src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java 23 Jan 2009 05:57:56 -0000 @@ -81,6 +81,37 @@ this.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[] {