langtools/test/tools/javac/T6241723.java
author katleman
Thu, 21 Aug 2014 14:16:14 -0700
changeset 25878 6d561031123e
parent 6150 d055fa8ced62
permissions -rw-r--r--
Added tag jdk9-b27 for changeset 98ce0879ab4c
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
}