test/tools/javac/T8016099/UncheckedWarningRegressionTest.java

Mon, 23 Sep 2013 17:27:38 +0400

author
kizune
date
Mon, 23 Sep 2013 17:27:38 +0400
changeset 2048
809a50f24d6f
parent 0
959103a6100f
permissions
-rw-r--r--

7154966: CRs found to be in Fixed state with no test and no noreg- keyword.
Reviewed-by: ksrini

     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 }

mercurial