4 * @author sogoel |
4 * @author sogoel |
5 * @summary Cyclic annotation not allowed |
5 * @summary Cyclic annotation not allowed |
6 * @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java |
6 * @compile/fail/ref=CyclicAnnotation.out -XDrawDiagnostics CyclicAnnotation.java |
7 */ |
7 */ |
8 |
8 |
9 import java.lang.annotation.ContainedBy; |
9 import java.lang.annotation.Repeatable; |
10 import java.lang.annotation.ContainerFor; |
|
11 |
10 |
12 @ContainedBy(Foo.class) |
11 @Repeatable(Foo.class) |
13 @ContainerFor(Baz.class) |
|
14 @interface Baz { |
12 @interface Baz { |
15 Foo[] value() default {}; |
13 Foo[] value() default {}; |
16 } |
14 } |
17 |
15 |
18 @ContainedBy(Baz.class) |
16 @Repeatable(Baz.class) |
19 @ContainerFor(Foo.class) |
|
20 @interface Foo{ |
17 @interface Foo{ |
21 Baz[] value() default {}; |
18 Baz[] value() default {}; |
22 } |
19 } |
23 |
20 |
24 @Foo(value = {@Baz,@Baz}) |
21 @Foo(value = {@Baz,@Baz}) |