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

Wed, 27 Apr 2016 01:34:52 +0800

author
aoqi
date
Wed, 27 Apr 2016 01:34:52 +0800
changeset 0
959103a6100f
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Initial load
http://hg.openjdk.java.net/jdk8u/jdk8u/langtools/
changeset: 2573:53ca196be1ae
tag: jdk8u25-b17

     1 /*
     2  * @test /nodynamiccopyright/
     3  * @bug 1234567
     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  */
     9 class DeclarationAnnotation {
    10     Object e1 = new @DA int[5];
    11     Object e2 = new @DA String[42];
    12     Object e3 = new @DA Object();
    13     Object ok = new @DA Object() { };
    14 }
    16 @interface DA { }

mercurial