test/tools/javac/annotations/repeatingAnnotations/MissingDefaultCase2.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 Missing default case for other method and return type is base annotation
jjg@1386 6 * @compile/fail/ref=MissingDefaultCase2.out -XDrawDiagnostics MissingDefaultCase2.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(FooContainer.class)
jjg@1386 13 @interface Foo {}
jjg@1386 14
jjg@1386 15 @ContainerFor(Foo.class)
jjg@1386 16 @interface FooContainer {
jjg@1386 17 Foo[] value();
jjg@1386 18 Foo other(); // missing default clause and return type is an annotation
jjg@1386 19 }
jjg@1386 20
jjg@1386 21 @Foo @Foo
jjg@1386 22 public class MissingDefaultCase2 {}

mercurial