1/* 2 * @test /nodynamiccopyright/ 3 * @bug 8013852 4 * @summary ensure that declaration annotations are not allowed on 5 * new array expressions 6 * @author Werner Dietl 7 * @compile/fail/ref=DeclarationAnnotation.out -XDrawDiagnostics DeclarationAnnotation.java 8 */ 9class DeclarationAnnotation { 10 Object e1 = new @DA int[5]; 11 Object e2 = new @DA String[42]; 12 Object e3 = new @DA Object(); 13 Object e4 = new @DA Object() { }; 14} 15 16@interface DA { } 17