Mon, 16 Aug 2010 14:56:23 +0100
6976649: javac does not enforce required annotation elements in arrays
Summary: type annotation should take advantage of recursive annotation checking
Reviewed-by: jjg
mcimadamore@629 | 1 | /* |
mcimadamore@629 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@634 | 3 | * @bug 6881115 6976649 |
mcimadamore@629 | 4 | * @summary javac permits nested anno w/o mandatory attrs => IncompleteAnnotationException |
mcimadamore@629 | 5 | * @author mcimadamore |
mcimadamore@629 | 6 | * @compile/fail/ref=T6881115.out -XDrawDiagnostics T6881115.java |
mcimadamore@629 | 7 | */ |
mcimadamore@629 | 8 | |
mcimadamore@629 | 9 | @interface A { |
mcimadamore@629 | 10 | B b() default @B(b2 = 1, b2 = 2); |
mcimadamore@629 | 11 | B[] b_arr() default {@B(), @B(b2 = 1, b2 = 2)}; |
mcimadamore@629 | 12 | } |
mcimadamore@629 | 13 | @interface B { |
mcimadamore@629 | 14 | String b1(); |
mcimadamore@629 | 15 | int b2(); |
mcimadamore@629 | 16 | } |
mcimadamore@634 | 17 | @A(b = @B(b2 = 1, b2 = 2), |
mcimadamore@634 | 18 | b_arr = {@B(), @B(b2 = 1, b2 = 2)}) |
mcimadamore@634 | 19 | class T6881115<@A(b = @B(b2 = 1, b2 = 2), |
mcimadamore@634 | 20 | b_arr = {@B(), @B(b2 = 1, b2 = 2)}) X> {} |