View | Details | Raw Unified | Return to bug 207758
Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompilationUnitDeclaration.java (-59 / +69 lines)
Lines 15-20 Link Here
15
15
16
import org.eclipse.jdt.core.compiler.CategorizedProblem;
16
import org.eclipse.jdt.core.compiler.CategorizedProblem;
17
import org.eclipse.jdt.core.compiler.CharOperation;
17
import org.eclipse.jdt.core.compiler.CharOperation;
18
import org.eclipse.jdt.core.compiler.IProblem;
18
import org.eclipse.jdt.internal.compiler.ASTVisitor;
19
import org.eclipse.jdt.internal.compiler.ASTVisitor;
19
import org.eclipse.jdt.internal.compiler.ClassFile;
20
import org.eclipse.jdt.internal.compiler.ClassFile;
20
import org.eclipse.jdt.internal.compiler.CompilationResult;
21
import org.eclipse.jdt.internal.compiler.CompilationResult;
Lines 207-240 Link Here
207
		CategorizedProblem[] problems = this.compilationResult.problems;
208
		CategorizedProblem[] problems = this.compilationResult.problems;
208
		int problemCount = this.compilationResult.problemCount;
209
		int problemCount = this.compilationResult.problemCount;
209
		long[] foundIrritants = new long[this.suppressWarningsCount];
210
		long[] foundIrritants = new long[this.suppressWarningsCount];
211
		CompilerOptions options = scope.compilerOptions();
212
		boolean hasErrors = false;
210
		nextProblem: for (int iProblem = 0, length = problemCount; iProblem < length; iProblem++) {
213
		nextProblem: for (int iProblem = 0, length = problemCount; iProblem < length; iProblem++) {
211
			CategorizedProblem problem = problems[iProblem];
214
			CategorizedProblem problem = problems[iProblem];
212
			int problemID = problem.getID();
215
			int problemID = problem.getID();
213
			long problemIrritant = ProblemReporter.getIrritant(problemID);
216
			if (problem.isError()) {
214
			boolean isWarning = problem.isWarning();
217
				if (problemID != IProblem.UnusedWarningToken) {
218
				// tolerate unused warning tokens which were promoted as errors
219
					hasErrors = true;
220
				}
221
				continue;
222
			}
215
			int start = problem.getSourceStart();
223
			int start = problem.getSourceStart();
216
			int end = problem.getSourceEnd();
224
			int end = problem.getSourceEnd();
225
			long irritant = ProblemReporter.getIrritant(problemID);
217
			nextSuppress: for (int iSuppress = 0, suppressCount = this.suppressWarningsCount; iSuppress < suppressCount; iSuppress++) {
226
			nextSuppress: for (int iSuppress = 0, suppressCount = this.suppressWarningsCount; iSuppress < suppressCount; iSuppress++) {
218
				long position = this.suppressWarningScopePositions[iSuppress];
227
				long position = this.suppressWarningScopePositions[iSuppress];
219
				int startSuppress = (int) (position >>> 32);
228
				int startSuppress = (int) (position >>> 32);
220
				int endSuppress = (int) position;
229
				int endSuppress = (int) position;
221
				if (start < startSuppress) continue nextSuppress;
230
				if (start < startSuppress) continue nextSuppress;
222
				if (end > endSuppress) continue nextSuppress;
231
				if (end > endSuppress) continue nextSuppress;
223
				if (isWarning) {
232
				if ((irritant & this.suppressWarningIrritants[iSuppress]) == 0)
224
					if ((problemIrritant & this.suppressWarningIrritants[iSuppress]) == 0)
233
					continue nextSuppress;
225
						continue nextSuppress;
234
				// discard suppressed warning
226
					// discard suppressed warning
235
				removed++;
227
					removed++;
236
				problems[iProblem] = null;
228
					problems[iProblem] = null;
237
				if (compilationResult.problemsMap != null) compilationResult.problemsMap.remove(problem);
229
					if (compilationResult.problemsMap != null) compilationResult.problemsMap.remove(problem);
238
				if (compilationResult.firstErrors != null) compilationResult.firstErrors.remove(problem);
230
					if (compilationResult.firstErrors != null) compilationResult.firstErrors.remove(problem);
239
				foundIrritants[iSuppress] |= irritant;
231
					foundIrritants[iSuppress] |= problemIrritant;
240
				continue nextProblem;
232
					continue nextProblem;
233
				} else {
234
					// any error may prevent further warnings to be emitted, hence shouldn't report unused warning tokens if in same scope
235
					foundIrritants[iSuppress] = this.suppressWarningIrritants[iSuppress]; // treat as used
236
					continue nextSuppress;					
237
				}
238
			}
241
			}
239
		}
242
		}
240
		// compact remaining problems
243
		// compact remaining problems
Lines 251-278 Link Here
251
			}
254
			}
252
			this.compilationResult.problemCount -= removed;
255
			this.compilationResult.problemCount -= removed;
253
		}
256
		}
254
		// flag SuppressWarnings which had no effect
257
		// flag SuppressWarnings which had no effect (only if no (mandatory) error got detected within unit
255
		if (scope.compilerOptions().getSeverity(CompilerOptions.UnusedWarningToken) != ProblemSeverities.Ignore) {
258
		if (!hasErrors) {
256
			for (int iSuppress = 0, suppressCount = this.suppressWarningsCount; iSuppress < suppressCount; iSuppress++) {
259
			int severity = options.getSeverity(CompilerOptions.UnusedWarningToken);
257
				Annotation annotation = this.suppressWarningAnnotations[iSuppress];
260
			if (severity != ProblemSeverities.Ignore) {
258
				if (annotation == null) continue; // implicit annotation
261
				for (int iSuppress = 0, suppressCount = this.suppressWarningsCount; iSuppress < suppressCount; iSuppress++) {
259
				long irritants = this.suppressWarningIrritants[iSuppress];
262
					Annotation annotation = this.suppressWarningAnnotations[iSuppress];
260
				if (~irritants == 0) continue; // @SuppressWarnings("all") also suppresses unused warning token
263
					if (annotation == null) continue; // implicit annotation
261
				if (irritants != foundIrritants[iSuppress]) { // mismatch, some warning tokens were unused
264
					long irritants = this.suppressWarningIrritants[iSuppress];
262
					MemberValuePair[] pairs = annotation.memberValuePairs();
265
					if (severity == ProblemSeverities.Warning && ~irritants == 0) continue; // @SuppressWarnings("all") also suppresses unused warning token
263
					pairLoop: for (int iPair = 0, pairCount = pairs.length; iPair < pairCount; iPair++) {
266
					if (irritants != foundIrritants[iSuppress]) { // mismatch, some warning tokens were unused
264
						MemberValuePair pair = pairs[iPair];
267
						MemberValuePair[] pairs = annotation.memberValuePairs();
265
						if (CharOperation.equals(pair.name, TypeConstants.VALUE)) {
268
						pairLoop: for (int iPair = 0, pairCount = pairs.length; iPair < pairCount; iPair++) {
266
							Expression value = pair.value;
269
							MemberValuePair pair = pairs[iPair];
267
							if (value instanceof ArrayInitializer) {
270
							if (CharOperation.equals(pair.name, TypeConstants.VALUE)) {
268
								ArrayInitializer initializer = (ArrayInitializer) value;
271
								Expression value = pair.value;
269
								Expression[] inits = initializer.expressions;
272
								if (value instanceof ArrayInitializer) {
270
								if (inits != null) {
273
									ArrayInitializer initializer = (ArrayInitializer) value;
271
									for (int iToken = 0, tokenCount = inits.length; iToken < tokenCount; iToken++) {
274
									Expression[] inits = initializer.expressions;
272
										Constant cst = inits[iToken].constant;
275
									if (inits != null) {
273
										if (cst != Constant.NotAConstant && cst.typeID() == TypeIds.T_JavaLangString) {
276
										for (int iToken = 0, tokenCount = inits.length; iToken < tokenCount; iToken++) {
274
											long irritant = CompilerOptions.warningTokenToIrritant(cst.stringValue());
277
											Constant cst = inits[iToken].constant;
275
											if (irritant != 0 && (foundIrritants[iSuppress] & irritant) == 0) {
278
											if (cst != Constant.NotAConstant && cst.typeID() == TypeIds.T_JavaLangString) {
279
												long irritant = CompilerOptions.warningTokenToIrritant(cst.stringValue());
280
												if (irritant != 0 && (foundIrritants[iSuppress] & irritant) == 0) {
281
													if (severity == ProblemSeverities.Warning) {
282
														int start = value.sourceStart, end = value.sourceEnd;
283
														nextSuppress: for (int jSuppress = iSuppress - 1; jSuppress >= 0; jSuppress--) {
284
															long position = this.suppressWarningScopePositions[jSuppress];
285
															int startSuppress = (int) (position >>> 32);
286
															int endSuppress = (int) position;
287
															if (start < startSuppress) continue nextSuppress;
288
															if (end > endSuppress) continue nextSuppress;
289
															if (~this.suppressWarningIrritants[jSuppress] == 0) break pairLoop; // suppress all?
290
														}
291
													}
292
													scope.problemReporter().unusedWarningToken(inits[iToken]);
293
												}
294
											}
295
										}
296
									}
297
								} else {
298
									Constant cst = value.constant;
299
									if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
300
										long irritant = CompilerOptions.warningTokenToIrritant(cst.stringValue());
301
										if (irritant != 0 && (foundIrritants[iSuppress] & irritant) == 0) {
302
											if (severity == ProblemSeverities.Warning) {
276
												int start = value.sourceStart, end = value.sourceEnd;
303
												int start = value.sourceStart, end = value.sourceEnd;
277
												nextSuppress: for (int jSuppress = iSuppress - 1; jSuppress >= 0; jSuppress--) {
304
												nextSuppress: for (int jSuppress = iSuppress - 1; jSuppress >= 0; jSuppress--) {
278
													long position = this.suppressWarningScopePositions[jSuppress];
305
													long position = this.suppressWarningScopePositions[jSuppress];
Lines 282-311 Link Here
282
													if (end > endSuppress) continue nextSuppress;
309
													if (end > endSuppress) continue nextSuppress;
283
													if (~this.suppressWarningIrritants[jSuppress] == 0) break pairLoop; // suppress all?
310
													if (~this.suppressWarningIrritants[jSuppress] == 0) break pairLoop; // suppress all?
284
												}
311
												}
285
												scope.problemReporter().unusedWarningToken(inits[iToken]);
286
											}
312
											}
313
											scope.problemReporter().unusedWarningToken(value);
287
										}
314
										}
288
									}
315
									}	
289
								}
316
								}
290
							} else {
317
								break pairLoop;
291
								Constant cst = value.constant;
292
								if (cst != Constant.NotAConstant && cst.typeID() == T_JavaLangString) {
293
									long irritant = CompilerOptions.warningTokenToIrritant(cst.stringValue());
294
									if (irritant != 0 && (foundIrritants[iSuppress] & irritant) == 0) {
295
										int start = value.sourceStart, end = value.sourceEnd;
296
										nextSuppress: for (int jSuppress = iSuppress - 1; jSuppress >= 0; jSuppress--) {
297
											long position = this.suppressWarningScopePositions[jSuppress];
298
											int startSuppress = (int) (position >>> 32);
299
											int endSuppress = (int) position;
300
											if (start < startSuppress) continue nextSuppress;
301
											if (end > endSuppress) continue nextSuppress;
302
											if (~this.suppressWarningIrritants[jSuppress] == 0) break pairLoop; // suppress all?
303
										}
304
										scope.problemReporter().unusedWarningToken(value);
305
									}
306
								}	
307
							}
318
							}
308
							break pairLoop;
309
						}
319
						}
310
					}
320
					}
311
				}
321
				}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/AnnotationTest.java (-22 / +143 lines)
Lines 7627-7632 Link Here
7627
				"	@SuppressWarnings(\"unchecked\") //unused\n" + 
7627
				"	@SuppressWarnings(\"unchecked\") //unused\n" + 
7628
				"	void doNoEvil(){\n" + 
7628
				"	void doNoEvil(){\n" + 
7629
				"	}\n" + 
7629
				"	}\n" + 
7630
				"}\n",
7631
				"Y.java",
7632
				"public class Y {\n" + 
7630
				"	Zork z;\n" + 
7633
				"	Zork z;\n" + 
7631
				"}\n",
7634
				"}\n",
7632
		},
7635
		},
Lines 7636-7642 Link Here
7636
		"	                  ^^^^^^^^^^^\n" + 
7639
		"	                  ^^^^^^^^^^^\n" + 
7637
		"Unnecessary @SuppressWarnings(\"unchecked\")\n" + 
7640
		"Unnecessary @SuppressWarnings(\"unchecked\")\n" + 
7638
		"----------\n" + 
7641
		"----------\n" + 
7639
		"2. ERROR in X.java (at line 5)\n" + 
7642
		"----------\n" + 
7643
		"1. ERROR in Y.java (at line 2)\n" + 
7640
		"	Zork z;\n" + 
7644
		"	Zork z;\n" + 
7641
		"	^^^^\n" + 
7645
		"	^^^^\n" + 
7642
		"Zork cannot be resolved to a type\n" + 
7646
		"Zork cannot be resolved to a type\n" + 
Lines 7665-7670 Link Here
7665
7669
7666
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7670
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7667
public void test230() {
7671
public void test230() {
7672
	Map options = this.getCompilerOptions();
7673
	options.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
7668
	this.runNegativeTest(
7674
	this.runNegativeTest(
7669
		new String[] {
7675
		new String[] {
7670
				"X.java",
7676
				"X.java",
Lines 7675-7681 Link Here
7675
				"@SuppressWarnings({\"all\"})\n" + 
7681
				"@SuppressWarnings({\"all\"})\n" + 
7676
				"class X2 {\n" + 
7682
				"class X2 {\n" + 
7677
				"	@SuppressWarnings({\"zork\", \"unused\" })\n" + 
7683
				"	@SuppressWarnings({\"zork\", \"unused\" })\n" + 
7678
				"	Zork foo() {}\n" + 
7684
				"	void foo() {}\n" + 
7679
				"}\n",
7685
				"}\n",
7680
		},
7686
		},
7681
		"----------\n" + 
7687
		"----------\n" + 
Lines 7684-7703 Link Here
7684
		"	                   ^^^^^^\n" + 
7690
		"	                   ^^^^^^\n" + 
7685
		"Unsupported @SuppressWarnings(\"zork\")\n" + 
7691
		"Unsupported @SuppressWarnings(\"zork\")\n" + 
7686
		"----------\n" + 
7692
		"----------\n" + 
7687
		"2. WARNING in X.java (at line 2)\n" + 
7693
		"2. ERROR in X.java (at line 2)\n" + 
7688
		"	@SuppressWarnings({\"zork\", \"unused\" })\n" + 
7694
		"	@SuppressWarnings({\"zork\", \"unused\" })\n" + 
7689
		"	                           ^^^^^^^^\n" + 
7695
		"	                           ^^^^^^^^\n" + 
7690
		"Unnecessary @SuppressWarnings(\"unused\")\n" + 
7696
		"Unnecessary @SuppressWarnings(\"unused\")\n" + 
7691
		"----------\n" + 
7697
		"----------\n" + 
7692
		"3. ERROR in X.java (at line 8)\n" + 
7698
		"3. ERROR in X.java (at line 7)\n" + 
7693
		"	Zork foo() {}\n" + 
7699
		"	@SuppressWarnings({\"zork\", \"unused\" })\n" + 
7694
		"	^^^^\n" + 
7700
		"	                           ^^^^^^^^\n" + 
7695
		"Zork cannot be resolved to a type\n" + 
7701
		"Unnecessary @SuppressWarnings(\"unused\")\n" + 
7696
		"----------\n");
7702
		"----------\n",
7703
		null,
7704
		false,
7705
		options);
7697
}
7706
}
7698
7707
7699
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7708
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7700
public void test231() {
7709
public void test231() {
7710
	Map options = this.getCompilerOptions();
7711
	options.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
7701
	this.runNegativeTest(
7712
	this.runNegativeTest(
7702
		new String[] {
7713
		new String[] {
7703
				"X.java",
7714
				"X.java",
Lines 7710-7728 Link Here
7710
				"class X2 {\n" + 
7721
				"class X2 {\n" + 
7711
				"	@SuppressWarnings(\"unused\")\n" + 
7722
				"	@SuppressWarnings(\"unused\")\n" + 
7712
				"	void foo() {}\n" + 
7723
				"	void foo() {}\n" + 
7713
				"	Zork z;\n" + 
7724
				"	Object z;\n" + 
7714
				"}\n",
7725
				"}\n",
7715
		},
7726
		},
7716
		"----------\n" + 
7727
		"----------\n" + 
7717
		"1. ERROR in X.java (at line 10)\n" + 
7728
		"1. ERROR in X.java (at line 2)\n" + 
7718
		"	Zork z;\n" + 
7729
		"	@SuppressWarnings({\"zork\", \"unused\",\"all\"})\n" + 
7719
		"	^^^^\n" + 
7730
		"	                           ^^^^^^^^\n" + 
7720
		"Zork cannot be resolved to a type\n" + 
7731
		"Unnecessary @SuppressWarnings(\"unused\")\n" + 
7721
		"----------\n");
7732
		"----------\n" + 
7733
		"2. ERROR in X.java (at line 6)\n" + 
7734
		"	@SuppressWarnings({\"all\"})\n" + 
7735
		"	                   ^^^^^\n" + 
7736
		"Unnecessary @SuppressWarnings(\"all\")\n" + 
7737
		"----------\n" + 
7738
		"3. ERROR in X.java (at line 8)\n" + 
7739
		"	@SuppressWarnings(\"unused\")\n" + 
7740
		"	                  ^^^^^^^^\n" + 
7741
		"Unnecessary @SuppressWarnings(\"unused\")\n" + 
7742
		"----------\n",
7743
		null,
7744
		false,
7745
		options);
7722
}
7746
}
7723
7747
7724
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7748
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7725
public void test232() {
7749
public void test232() {
7750
	Map options = this.getCompilerOptions();
7751
	options.put(CompilerOptions.OPTION_ReportUnusedWarningToken, CompilerOptions.ERROR);
7726
	this.runNegativeTest(
7752
	this.runNegativeTest(
7727
		new String[] {
7753
		new String[] {
7728
				"X.java",
7754
				"X.java",
Lines 7736-7754 Link Here
7736
				"	}\n" + 
7762
				"	}\n" + 
7737
				"    }\n" + 
7763
				"    }\n" + 
7738
				"}\n" +
7764
				"}\n" +
7739
				"class Y extends Zork{}",
7765
				"class Y {}",
7740
		},
7766
		},
7741
		"----------\n" + 
7767
		"----------\n" + 
7742
		"1. WARNING in X.java (at line 2)\n" + 
7768
		"1. ERROR in X.java (at line 2)\n" + 
7743
		"	@SuppressWarnings({\"finally\",\"finally\"})\n" + 
7769
		"	@SuppressWarnings({\"finally\",\"finally\"})\n" + 
7744
		"	                             ^^^^^^^^^\n" + 
7770
		"	                             ^^^^^^^^^\n" + 
7745
		"Unnecessary @SuppressWarnings(\"finally\")\n" + 
7771
		"Unnecessary @SuppressWarnings(\"finally\")\n" + 
7746
		"----------\n" + 
7772
		"----------\n",
7747
		"2. ERROR in X.java (at line 11)\n" + 
7773
		null,
7748
		"	class Y extends Zork{}\n" + 
7774
		false,
7749
		"	                ^^^^\n" + 
7775
		options);
7750
		"Zork cannot be resolved to a type\n" + 
7751
		"----------\n");
7752
}
7776
}
7753
7777
7754
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
7778
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=127533 - variation
Lines 7799-7802 Link Here
7799
		"Zork cannot be resolved\n" + 
7823
		"Zork cannot be resolved\n" + 
7800
		"----------\n");
7824
		"----------\n");
7801
}
7825
}
7826
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207758
7827
public void test235() {
7828
	this.runNegativeTest(
7829
		new String[] {
7830
				"X.java",
7831
				"import java.util.List;\n" + 
7832
				"public class X {\n" + 
7833
				"        void foo() {\n" + 
7834
				"                ArrayList al = null;\n" + 
7835
				"                @SuppressWarnings(\"unchecked\")\n" + 
7836
				"                List<String> ls = al;\n" + 
7837
				"        }\n" + 
7838
				"}",
7839
		},
7840
		"----------\n" + 
7841
		"1. ERROR in X.java (at line 4)\n" + 
7842
		"	ArrayList al = null;\n" + 
7843
		"	^^^^^^^^^\n" + 
7844
		"ArrayList cannot be resolved to a type\n" + 
7845
		"----------\n");
7846
}
7847
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207758 - variation
7848
public void test236() {
7849
	this.runNegativeTest(
7850
		new String[] {
7851
				"X.java",
7852
				"import java.util.List;\n" + 
7853
				"public class X {\n" + 
7854
				"	void foo() {\n" + 
7855
				"		@SuppressWarnings(\"unchecked\")\n" + 
7856
				"		List<String> ls = bar();\n" + 
7857
				"	}\n" + 
7858
				"	ArrayList bar() {\n" + 
7859
				"		return null;\n" + 
7860
				"	}\n" + 
7861
				"}",
7862
		},
7863
		"----------\n" + 
7864
		"1. ERROR in X.java (at line 5)\n" + 
7865
		"	List<String> ls = bar();\n" + 
7866
		"	                  ^^^\n" + 
7867
		"The method bar() is undefined for the type X\n" + 
7868
		"----------\n" + 
7869
		"2. ERROR in X.java (at line 7)\n" + 
7870
		"	ArrayList bar() {\n" + 
7871
		"	^^^^^^^^^\n" + 
7872
		"ArrayList cannot be resolved to a type\n" + 
7873
		"----------\n");
7874
}
7875
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=207758 - variation
7876
public void test237() {
7877
	this.runNegativeTest(
7878
		new String[] {
7879
				"X.java",
7880
				"import java.util.List;\n" + 
7881
				"public class X<B extends ArrayList> {\n" + 
7882
				"	B get() { return null; }\n" + 
7883
				"	void foo() {\n" + 
7884
				"		@SuppressWarnings(\"unchecked\")\n" + 
7885
				"		List<String> ls = get();\n" + 
7886
				"	}\n" + 
7887
				"}",
7888
		},
7889
		"----------\n" + 
7890
		"1. ERROR in X.java (at line 2)\n" + 
7891
		"	public class X<B extends ArrayList> {\n" + 
7892
		"	                         ^^^^^^^^^\n" + 
7893
		"ArrayList cannot be resolved to a type\n" + 
7894
		"----------\n" + 
7895
		"2. ERROR in X.java (at line 6)\n" + 
7896
		"	List<String> ls = get();\n" + 
7897
		"	                  ^^^^^\n" + 
7898
		"Type mismatch: cannot convert from B to List<String>\n" + 
7899
		"----------\n");
7900
}
7901
public void test238() {
7902
	// check that if promoted to ERROR, unhandled warning token shouldn't be suppressed by @SuppressWarnings("all")
7903
	Map options = this.getCompilerOptions();
7904
	options.put(CompilerOptions.OPTION_ReportUnhandledWarningToken, CompilerOptions.ERROR);
7905
	this.runNegativeTest(
7906
		new String[] {
7907
				"X.java",
7908
				"public class X {\n" + 
7909
				"	@SuppressWarnings({\"zork\",\"all\"})\n" + 
7910
				"	void foo() {}\n" + 
7911
				"}\n",
7912
		},
7913
		"----------\n" + 
7914
		"1. ERROR in X.java (at line 2)\n" + 
7915
		"	@SuppressWarnings({\"zork\",\"all\"})\n" + 
7916
		"	                   ^^^^^^\n" + 
7917
		"Unsupported @SuppressWarnings(\"zork\")\n" + 
7918
		"----------\n",
7919
		null,
7920
		false,
7921
		options);
7922
}
7802
}
7923
}
(-)src/org/eclipse/jdt/core/tests/compiler/regression/VarargsTest.java (-7 / +2 lines)
Lines 1918-1934 Link Here
1918
				"	^^^^\n" + 
1918
				"	^^^^\n" + 
1919
				"Zork cannot be resolved to a type\n" + 
1919
				"Zork cannot be resolved to a type\n" + 
1920
				"----------\n" + 
1920
				"----------\n" + 
1921
				"2. WARNING in X.java (at line 17)\n" + 
1921
				"2. WARNING in X.java (at line 19)\n" + 
1922
				"	@SuppressWarnings(\"boxing\")\n" + 
1923
				"	                  ^^^^^^^^\n" + 
1924
				"Unnecessary @SuppressWarnings(\"boxing\")\n" + 
1925
				"----------\n" + 
1926
				"3. WARNING in X.java (at line 19)\n" + 
1927
				"	varargs(i);\n" + 
1922
				"	varargs(i);\n" + 
1928
				"	^^^^^^^^^^\n" + 
1923
				"	^^^^^^^^^^\n" + 
1929
				"The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" + 
1924
				"The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" + 
1930
				"----------\n" + 
1925
				"----------\n" + 
1931
				"4. WARNING in X.java (at line 22)\n" + 
1926
				"3. WARNING in X.java (at line 22)\n" + 
1932
				"	varargs(i.clone());\n" + 
1927
				"	varargs(i.clone());\n" + 
1933
				"	^^^^^^^^^^^^^^^^^^\n" + 
1928
				"	^^^^^^^^^^^^^^^^^^\n" + 
1934
				"The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" + 
1929
				"The argument of type Integer[] should explicitly be cast to Object[] for the invocation of the varargs method varargs(Object...) from type X. It could alternatively be cast to Object for a varargs invocation\n" + 

Return to bug 207758