View | Details | Raw Unified | Return to bug 261323 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (+31 lines)
Lines 81-86 Link Here
81
		this.reportMissingJavadocComments = null;
81
		this.reportMissingJavadocComments = null;
82
	}
82
	}
83
83
84
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=261323.
85
	// Test to make sure that the use of a static import as an annotation value counts as a use
86
	// (and consequently that there is no unused static import warning)
87
	public void test261323() {
88
		Map customOptions = getCompilerOptions();
89
		
90
		customOptions.put(CompilerOptions.OPTION_ReportUnusedImport, CompilerOptions.ERROR);
91
		customOptions.put(CompilerOptions.OPTION_SuppressWarnings, CompilerOptions.ENABLED);
92
		customOptions.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
93
94
		runNegativeTest(
95
			true,
96
			new String[] {
97
					"com/SomeTest.java",
98
					"package com;\n" + 
99
					"import static com.SomeTest.UNCHECKED;\n" + 
100
					"@SuppressWarnings(UNCHECKED)\n" + 
101
					"public class SomeTest {\n" + 
102
					"    public static final String UNCHECKED = \"unchecked\";\n" + 
103
					"}\n"
104
			}, 
105
			null, customOptions,
106
			"----------\n" +
107
			"1. ERROR in com\\SomeTest.java (at line 3)\n" +
108
			"	@SuppressWarnings(UNCHECKED)\n" +
109
			"	                  ^^^^^^^^^\n" +
110
			"Unnecessary @SuppressWarnings(\"unchecked\")\n" +
111
			"----------\n",
112
			JavacTestOptions.Excuse.EclipseWarningConfiguredAsError);
113
	}
114
84
	public void test001() {
115
	public void test001() {
85
		this.runConformTest(
116
		this.runConformTest(
86
			new String[] {
117
			new String[] {

Return to bug 261323