langtools/test/tools/javac/T6554097.java
author alundblad
Mon, 18 Apr 2016 22:25:50 +0200
changeset 37634 a5f740ef93f2
parent 8225 e9e5670e6a71
permissions -rw-r--r--
7152104: javac should not warn about missing serialVersionUID for anonymous inner classes Summary: Javac no longer issues warnings for missing serialVersionUID in anonymous classes. Reviewed-by: jlahoda
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     1
/*
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     3
 * @bug     6554097
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     4
 * @summary "final" confuses at-SuppressWarnings
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     5
 * @compile T6554097.java
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
     6
 * @compile/fail/ref=T6554097.out -XDrawDiagnostics -Werror -Xlint:rawtypes T6554097.java
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     7
 */
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
     8
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
     9
import java.util.ArrayList;
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    10
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    11
class T6554097 {
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    12
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    13
    @SuppressWarnings("unchecked") final ArrayList[] v1 = { new ArrayList() {} };
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    14
    @SuppressWarnings("unchecked")       ArrayList[] v2 = { new ArrayList() {} };
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    15
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    16
    public static void m1() throws Throwable {
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    17
            @SuppressWarnings("unchecked") final ArrayList[] v3 = { new ArrayList() {} };
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    18
            @SuppressWarnings("unchecked")       ArrayList[] v4 = { new ArrayList() {} };
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    19
    }
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    20
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    21
    final ArrayList[] v5 = { new ArrayList() {} };
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    22
          ArrayList[] v6 = { new ArrayList() {} };
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    23
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    24
    public static void m2() throws Throwable {
37634
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    25
        final ArrayList[] v7 = { new ArrayList() {} };
a5f740ef93f2 7152104: javac should not warn about missing serialVersionUID for anonymous inner classes
alundblad
parents: 8225
diff changeset
    26
              ArrayList[] v8 = { new ArrayList() {} };
8225
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    27
    }
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    28
}
e9e5670e6a71 6554097: "final" confuses @SuppressWarnings
jjg
parents:
diff changeset
    29