test/tools/javac/annotations/repeatingAnnotations/BaseAnnoAsContainerAnno.java

Mon, 03 Dec 2012 11:16:32 +0100

author
jfranck
date
Mon, 03 Dec 2012 11:16:32 +0100
changeset 1445
376d6c1b49e5
parent 1386
bf76f4190ef8
child 1492
df694c775e8a
permissions
-rw-r--r--

8001114: Container annotation is not checked for semantic correctness
Reviewed-by: jjg

jjg@1386 1 /**
jjg@1386 2 * @test /nodynamiccopyright/
jjg@1386 3 * @bug 7169362
jjg@1386 4 * @author sogoel
jjg@1386 5 * @summary Base annotation specify itself as ContainerAnnotation
jjg@1386 6 * @compile/fail/ref=BaseAnnoAsContainerAnno.out -XDrawDiagnostics BaseAnnoAsContainerAnno.java
jjg@1386 7 */
jjg@1386 8
jjg@1386 9 import java.lang.annotation.ContainedBy;
jjg@1386 10 import java.lang.annotation.ContainerFor;
jjg@1386 11
jjg@1386 12 @ContainedBy(Foo.class)
jjg@1386 13 @ContainerFor(Foo.class)
jjg@1386 14 @interface Foo {
jjg@1386 15 Foo[] value() default {};
jjg@1386 16 }
jjg@1386 17
jjg@1386 18 @Foo() @Foo()
jjg@1386 19 public class BaseAnnoAsContainerAnno {}
jjg@1386 20

mercurial