1/** 2 * @test /nodynamiccopyright/ 3 * @bug 8029376 4 * @summary Verify reasonable errors for erroneous annotations, and incorrectly used types 5 * @compile/fail/ref=ErroneousAnnotations.out -XDrawDiagnostics ErroneousAnnotations.java 6 */ 7class ErroneousAnnotations { 8 @Undefined //no "is not an annotation type error" 9 private int f1; 10 @String //produce "is not an annotation type error" 11 private int f2; 12 @Annot(@Undefined) 13 private int f3; 14 @Annot(@String) 15 private int f4; 16 @Primitive(@Undefined) 17 private int f5; 18 @Primitive(@String) 19 private int f6; 20 @PrimitiveWrap(@PrimitiveImpl) 21 private int f7; 22 23 @interface Annot { 24 Undefined value(); 25 } 26 27 @interface PrimitiveWrap { 28 Primitive value(); 29 } 30 31 @interface Primitive { 32 int value(); 33 } 34 35 interface PrimitiveImpl extends Primitive { 36 } 37} 38 39