langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java
author jjg
Tue, 15 Oct 2013 15:57:13 -0700
changeset 21041 99f5e5e97425
child 24292 12414a72f8d2
permissions -rw-r--r--
8026564: import changes from type-annotations forest Reviewed-by: jjg Contributed-by: wdietl@gmail.com, steve.sides@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21041
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     1
/*
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     3
 * @bug 1234567
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     4
 * @summary The parts of a fully-qualified type can't be annotated.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     5
 * @author Werner Dietl
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     6
 * @compile/fail/ref=CantAnnotatePackages.out -XDrawDiagnostics CantAnnotatePackages.java
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     7
 */
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     8
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
     9
import java.lang.annotation.*;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    10
import java.util.List;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    11
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    12
class CantAnnotatePackages {
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    13
    // Before a package component:
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    14
    @TA java.lang.Object of1;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    15
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    16
    // These result in a different error.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    17
    // TODO: should this be unified?
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    18
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    19
    List<@TA java.lang.Object> of2;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    20
    java. @TA lang.Object of3;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    21
    List<java. @TA lang.Object> of4;
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    22
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    23
    // TODO: also note the order of error messages.
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    24
}
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    25
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    26
@Target(ElementType.TYPE_USE)
99f5e5e97425 8026564: import changes from type-annotations forest
jjg
parents:
diff changeset
    27
@interface TA { }