Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2012 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 12-17
Link Here
|
12 |
|
12 |
|
13 |
import java.util.Map; |
13 |
import java.util.Map; |
14 |
|
14 |
|
|
|
15 |
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; |
15 |
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; |
16 |
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; |
16 |
|
17 |
|
17 |
import junit.framework.Test; |
18 |
import junit.framework.Test; |
Lines 24-30
Link Here
|
24 |
// All specified tests which does not belong to the class are skipped... |
25 |
// All specified tests which does not belong to the class are skipped... |
25 |
static { |
26 |
static { |
26 |
// TESTS_NAMES = new String[] { "test127" }; |
27 |
// TESTS_NAMES = new String[] { "test127" }; |
27 |
// TESTS_NUMBERS = new int[] { 5 }; |
28 |
// TESTS_NUMBERS = new int[] { 7 }; |
28 |
// TESTS_RANGE = new int[] { 169, 180 }; |
29 |
// TESTS_RANGE = new int[] { 169, 180 }; |
29 |
} |
30 |
} |
30 |
|
31 |
|
Lines 258-261
Link Here
|
258 |
// javac options |
259 |
// javac options |
259 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); |
260 |
JavacTestOptions.Excuse.EclipseWarningConfiguredAsError /* javac test options */); |
260 |
} |
261 |
} |
|
|
262 |
public void test007() { |
263 |
if (this.complianceLevel < ClassFileConstants.JDK1_5) { |
264 |
return; |
265 |
} |
266 |
Map customOptions = getCompilerOptions(); |
267 |
customOptions.put(CompilerOptions.OPTION_FatalOptionalError, |
268 |
CompilerOptions.ENABLED); |
269 |
customOptions.put(CompilerOptions.OPTION_ReportUnusedLocal, |
270 |
CompilerOptions.ERROR); |
271 |
customOptions.put(CompilerOptions.OPTION_SuppressWarnings, |
272 |
CompilerOptions.ENABLED); |
273 |
customOptions.put(CompilerOptions.OPTION_SuppressOptionalErrors, |
274 |
CompilerOptions.ENABLED); |
275 |
customOptions.put(CompilerOptions.OPTION_ReportUnusedWarningToken, |
276 |
CompilerOptions.ERROR); |
277 |
runConformTest( |
278 |
new String[] { /* test files */ |
279 |
"X.java", |
280 |
"public class X {\n" + |
281 |
" @SuppressWarnings(\"unused\")\n" + |
282 |
" static void foo() {\n" + |
283 |
" String s = null;\n" + |
284 |
" System.out.println(\"SUCCESS\");\n" + |
285 |
" }\n" + |
286 |
" public static void main(String argv[]) {\n" + |
287 |
" foo();\n" + |
288 |
" }\n" + |
289 |
"}" |
290 |
}, |
291 |
"SUCCESS" /* expected output string */, |
292 |
null /* no class libraries */, |
293 |
true, |
294 |
null, |
295 |
customOptions /* custom options */, |
296 |
// compiler results |
297 |
null /* do not check error string */); |
298 |
} |
261 |
} |
299 |
} |