Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8016099
4 * @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes )
5 * @compile UncheckedWarningRegressionTest.java
6 * @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java
7 */
9 public class UncheckedWarningRegressionTest {
10 <T> void suppressedWarningsFinalInitializer() {
11 @SuppressWarnings("unchecked")
12 T[] tt = (T[]) FINAL_EMPTY_ARRAY;
13 }
15 final Object[] FINAL_EMPTY_ARRAY = {};
17 <T> void finalInitializer() {
18 T[] tt = (T[]) FINAL_EMPTY_ARRAY;
19 }
21 <T> void suppressedWarningsNonFinalInitializer() {
22 @SuppressWarnings("unchecked")
23 T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
24 }
26 Object[] NON_FINAL_EMPTY_ARRAY = {};
28 <T> void nonFinalInitializer() {
29 T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY;
30 }
32 }