test/langtools/tools/javac/T6241723.java
author darcy
Wed, 27 Jun 2018 21:01:12 -0700
changeset 50892 a5557f24b4d4
parent 47216 71c04702a3d5
permissions -rw-r--r--
8205615: Start of release updates for JDK 12 8205621: Increment JDK version for JDK 12 8193292: Add SourceVersion.RELEASE_12 8193290: Add source 12 and target 12 to javac 8205619: Bump maximum recognized class file version to 56 for JDK 12 Reviewed-by: alanb, smarks, jjg, mr, erikj, psandoz, dholmes Contributed-by: erik.joelsson@oracle.com, mikael.vidstedt@oracle.com, joe.darcy@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
     2
 * @test  /nodynamiccopyright/
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 6241723
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary compiler can miss some references to at-Deprecated classes
6150
d055fa8ced62 6971882: Remove -XDstdout from javac test
jjg
parents: 10
diff changeset
     5
 * @compile/fail/ref=T6241723.out -XDrawDiagnostics -Xlint:deprecation -Werror T6241723.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
@Deprecated class A1
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
{
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
class A2
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
{
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    @Deprecated
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        static class A21 { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
public class T6241723 {
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
    // references to earlier classes
06bc494ca11e Initial load
duke
parents:
diff changeset
    21
    A1 a1;      // warning
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
    A2 a2;      // OK
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
    A2.A21 a21; // warning
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
    // forward references to classes not yet seen
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
    Z1 z1;      // warning
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
    Z2 z2;      // OK
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
    Z2.Z21 z21; // warning
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
@Deprecated class Z1
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
{
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
}
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
class Z2
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
{
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
    @Deprecated
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
        static class Z21 { }
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
}