diff -r 000000000000 -r 959103a6100f test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.java Wed Apr 27 01:34:52 2016 +0800 @@ -0,0 +1,27 @@ +/* + * @test /nodynamiccopyright/ + * @bug 1234567 + * @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 of4; + + // TODO: also note the order of error messages. +} + +@Target(ElementType.TYPE_USE) +@interface TA { }