test/tools/javac/annotations/typeAnnotations/newlocations/AnonymousClass.java

changeset 2168
119747cd9f25
parent 1755
ddb4a2bfcd82
child 2525
2eb010b6cb22
equal deleted inserted replaced
2167:d2fa3f7e964e 2168:119747cd9f25
30 * @author Werner Dietl 30 * @author Werner Dietl
31 * @compile AnonymousClass.java 31 * @compile AnonymousClass.java
32 */ 32 */
33 class AnonymousClass { 33 class AnonymousClass {
34 Object o1 = new @TA Object() { }; 34 Object o1 = new @TA Object() { };
35 // Declaration annotations are also allowed. 35 Object o2 = new @TA Object() { };
36 Object o2 = new @TA @DA Object() { };
37 } 36 }
38
39 @interface DA { }
40 37
41 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 38 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
42 @interface TA { } 39 @interface TA { }
43 40
44 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) 41 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})

mercurial