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

Wed, 14 Nov 2018 10:18:25 -0800

author
diazhou
date
Wed, 14 Nov 2018 10:18:25 -0800
changeset 3762
7909abb85562
parent 1521
71f35e4b93a5
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Added tag jdk8u201-b04 for changeset a7f48b9dfb82

     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