Sat, 22 Dec 2018 13:10:38 -0800
Added tag jdk8u202-b25 for changeset 15d8c732039b
aoqi@0 | 1 | /* |
aoqi@0 | 2 | * @test /nodynamiccopyright/ |
aoqi@0 | 3 | * @bug 8016099 |
aoqi@0 | 4 | * @summary Some SuppressWarnings annotations ignored ( unchecked, rawtypes ) |
aoqi@0 | 5 | * @compile UncheckedWarningRegressionTest.java |
aoqi@0 | 6 | * @compile/fail/ref=UncheckedWarningRegressionTest.out -XDrawDiagnostics -Werror -Xlint:unchecked UncheckedWarningRegressionTest.java |
aoqi@0 | 7 | */ |
aoqi@0 | 8 | |
aoqi@0 | 9 | public class UncheckedWarningRegressionTest { |
aoqi@0 | 10 | <T> void suppressedWarningsFinalInitializer() { |
aoqi@0 | 11 | @SuppressWarnings("unchecked") |
aoqi@0 | 12 | T[] tt = (T[]) FINAL_EMPTY_ARRAY; |
aoqi@0 | 13 | } |
aoqi@0 | 14 | |
aoqi@0 | 15 | final Object[] FINAL_EMPTY_ARRAY = {}; |
aoqi@0 | 16 | |
aoqi@0 | 17 | <T> void finalInitializer() { |
aoqi@0 | 18 | T[] tt = (T[]) FINAL_EMPTY_ARRAY; |
aoqi@0 | 19 | } |
aoqi@0 | 20 | |
aoqi@0 | 21 | <T> void suppressedWarningsNonFinalInitializer() { |
aoqi@0 | 22 | @SuppressWarnings("unchecked") |
aoqi@0 | 23 | T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY; |
aoqi@0 | 24 | } |
aoqi@0 | 25 | |
aoqi@0 | 26 | Object[] NON_FINAL_EMPTY_ARRAY = {}; |
aoqi@0 | 27 | |
aoqi@0 | 28 | <T> void nonFinalInitializer() { |
aoqi@0 | 29 | T[] tt = (T[]) NON_FINAL_EMPTY_ARRAY; |
aoqi@0 | 30 | } |
aoqi@0 | 31 | |
aoqi@0 | 32 | } |