T6881115.java revision 1520:71f35e4b93a5
1import java.lang.annotation.Target; 2import java.lang.annotation.ElementType; 3 4/* 5 * @test /nodynamiccopyright/ 6 * @bug 6881115 6976649 7 * @summary javac permits nested anno w/o mandatory attrs => IncompleteAnnotationException 8 * @author mcimadamore 9 * @compile/fail/ref=T6881115.out -XDrawDiagnostics T6881115.java 10 */ 11 12@Target({ElementType.TYPE, ElementType.TYPE_PARAMETER, ElementType.ANNOTATION_TYPE}) 13@interface A { 14 B b() default @B(b2 = 1, b2 = 2); 15 B[] b_arr() default {@B(), @B(b2 = 1, b2 = 2)}; 16} 17 18@interface B { 19 String b1(); 20 int b2(); 21} 22 23@A(b = @B(b2 = 1, b2 = 2), 24 b_arr = {@B(), @B(b2 = 1, b2 = 2)}) 25class T6881115<@A(b = @B(b2 = 1, b2 = 2), 26 b_arr = {@B(), @B(b2 = 1, b2 = 2)}) X> {} 27