test/tools/javac/annotations/6881115/T6881115.java

Thu, 31 Aug 2017 15:17:03 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:17:03 +0800
changeset 2525
2eb010b6cb22
parent 1521
71f35e4b93a5
parent 0
959103a6100f
permissions
-rw-r--r--

merge

     1 import java.lang.annotation.Target;
     2 import java.lang.annotation.ElementType;
     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  */
    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 }
    18 @interface B {
    19     String b1();
    20     int b2();
    21 }
    23 @A(b = @B(b2 = 1, b2 = 2),
    24    b_arr = {@B(), @B(b2 = 1, b2 = 2)})
    25 class T6881115<@A(b = @B(b2 = 1, b2 = 2),
    26                   b_arr = {@B(), @B(b2 = 1, b2 = 2)}) X> {}

mercurial