langtools/test/tools/javac/T6554097.java
author jlahoda
Tue, 16 Aug 2016 16:43:00 +0200
changeset 40504 0a01f6710c84
parent 37634 a5f740ef93f2
permissions -rw-r--r--
8078561: Error message should be generated once when -source 6 is specified Summary: Code to avoid duplicated errors about features not supported in the current source level moved to Log Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug     6554097
 * @summary "final" confuses at-SuppressWarnings
 * @compile T6554097.java
 * @compile/fail/ref=T6554097.out -XDrawDiagnostics -Werror -Xlint:rawtypes T6554097.java
 */

import java.util.ArrayList;

class T6554097 {

    @SuppressWarnings("unchecked") final ArrayList[] v1 = { new ArrayList() {} };
    @SuppressWarnings("unchecked")       ArrayList[] v2 = { new ArrayList() {} };

    public static void m1() throws Throwable {
            @SuppressWarnings("unchecked") final ArrayList[] v3 = { new ArrayList() {} };
            @SuppressWarnings("unchecked")       ArrayList[] v4 = { new ArrayList() {} };
    }

    final ArrayList[] v5 = { new ArrayList() {} };
          ArrayList[] v6 = { new ArrayList() {} };

    public static void m2() throws Throwable {
        final ArrayList[] v7 = { new ArrayList() {} };
              ArrayList[] v8 = { new ArrayList() {} };
    }
}