test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java

Tue, 14 May 2013 15:04:06 -0700

author
jjg
date
Tue, 14 May 2013 15:04:06 -0700
changeset 1755
ddb4a2bfcd82
child 2210
a746587a1ff1
permissions
-rw-r--r--

8013852: update reference impl for type-annotations
Reviewed-by: jjg
Contributed-by: wdietl@gmail.com, steve.sides@oracle.com, joel.franck@oracle.com, alex.buckley@oracle.com

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

mercurial