langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java
author jjg
Fri, 02 May 2014 16:41:10 -0700
changeset 24292 12414a72f8d2
parent 21041 99f5e5e97425
child 26532 aa84b6606229
permissions -rw-r--r--
8042358: some tests have placeholder bugid 1234567 Reviewed-by: mduigou
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/
24292
12414a72f8d2 8042358: some tests have placeholder bugid 1234567
jjg
parents: 21041
diff changeset
     3
 * @bug 8026564
21041
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 { }