import java.lang.annotation.*; import java.util.*; import static java.lang.annotation.ElementType.*; @interface AA1 { } @Repeatable(AA1.class) @interface A1 { } @interface AA2 { String[] value(); } @Repeatable(AA2.class) @interface A2 { } @interface AA3 { A3[] value(); } @Repeatable(AA3.class) @Retention(RetentionPolicy.RUNTIME) @interface A3 { } @interface A4 { } @A4 @A4 class C4 { } @A4 class C4bis { } @A1 @A1 class C5 { } @A1 class C5bis { } @interface AA6 { A6[] value() default { }; } @Repeatable(AA6.class) @interface A6 { } @A6 @A6 @AA6 class C6 { } @A6 @A6 class C6bis1 { } @A6 @AA6 class C6bis2 { } @A6 @AA6 @AA6 class C6bis3 { } @Target({TYPE_USE}) @interface TA { } class DupTypeAnno { List<@TA @TA String> l = null; Boolean[] b = new Boolean @TA @TA [42]; { this.<@TA String @TA @TA []>m(); this.<@TA @TA String @TA []>m(); this.<@TA String @TA [] @TA []>m(); } static void m() { } } @interface AA7 { A7[] value() default { }; } @Target({METHOD}) @Repeatable(AA7.class) @interface A7 { } @Target({METHOD}) @interface AA8 { A8[] value() default { }; } @Target({METHOD, FIELD}) @Repeatable(AA8.class) @interface A8 { } class C8 { @A8 int f1; @A8 @A8 int f2; @A8 @A8 void m() { } } @interface AA9 { A9[] value(); int i(); } @Repeatable(AA9.class) @interface A9 { } @Repeatable(Annotation.class) @interface A10 {} @interface AA11 { A11[] value();} @Documented @Repeatable(AA11.class) @interface A11 { } class ElementTypeContainerRules { @Repeatable(Tags1.class) @Target(TYPE_USE) @interface Tag1 { String value(); } @Target(TYPE) @interface Tags1 { Tag1[] value(); } @Repeatable(Tags2.class) @Target(TYPE) @interface Tag2 { String value(); } @Target(ANNOTATION_TYPE) @interface Tags2 { Tag2[] value(); } @Repeatable(Tags3.class) @Target(TYPE_USE) @interface Tag3 { String value(); } @Target(TYPE_PARAMETER) @interface Tags3 { Tag3[] value(); } @Repeatable(Tags4.class) @Target(TYPE_USE) @interface Tag4 { String value(); } @Target(ANNOTATION_TYPE) @interface Tags4 { Tag4[] value(); } }