Thu, 05 Aug 2010 09:44:54 +0100
6881115: javac permits nested anno w/o mandatory attrs => IncompleteAnnotationException
Summary: default annotation value is not attributed
Reviewed-by: jjg, darcy
mcimadamore@629 | 1 | /* |
mcimadamore@629 | 2 | * @test /nodynamiccopyright/ |
mcimadamore@629 | 3 | * @bug 6881115 |
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@629 | 17 | @A |
mcimadamore@629 | 18 | class T6881115 {} |