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

/*
 * @test /nodynamiccopyright/
 * @bug 8026564
 * @summary The parts of a fully-qualified type can't be annotated.
 * @author Werner Dietl
 * @compile/fail/ref=CantAnnotatePackages.out -XDrawDiagnostics CantAnnotatePackages.java
 */

import java.lang.annotation.*;
import java.util.List;

class CantAnnotatePackages {
    // Before a package component:
    @TA java.lang.Object of1;

    // These result in a different error.
    // TODO: should this be unified?

    List<@TA java.lang.Object> of2;
    java. @TA lang.Object of3;
    List<java. @TA lang.Object> of4;

    // TODO: also note the order of error messages.
}

@Target(ElementType.TYPE_USE)
@interface TA { }