T8022765.java revision 2069:b7d8b71e1658
1/** 2 * @test /nodynamiccopyright/ 3 * @bug 8022765 4 * @summary javac should not crash for incorrect attribute values 5 * @build VerifyAnnotationsAttributed 6 * @run main VerifyAnnotationsAttributed T8022765.java 7 * @compile/fail/ref=T8022765.out -XDrawDiagnostics T8022765.java 8 */ 9@Ann(@Override) 10@Primitive(@Override) 11@Str(@Override) 12@En(@Override) 13@ArrAnn(@Override) 14@ArrPrimitive(@Override) 15@ArrStr(@Override) 16@ArrEn(@Override) 17class AnnC { } 18 19class PrimitiveC { 20 private static final int C = 1; 21 @Ann(C) 22 @Primitive(C) 23 @Str(C) 24 @En(C) 25 @ArrAnn(C) 26 @ArrPrimitive(C) 27 @ArrStr(C) 28 @ArrEn(C) 29 class I { 30 } 31} 32 33class StringC { 34 35 private static final String C = ""; 36 37 @Ann(C) 38 @Primitive(C) 39 @Str(C) 40 @En(C) 41 @ArrAnn(C) 42 @ArrPrimitive(C) 43 @ArrStr(C) 44 @ArrEn(C) 45 class I { 46 } 47} 48 49@Ann(E.A) 50@Primitive(E.A) 51@Str(E.A) 52@En(E.A) 53@ArrAnn(E.A) 54@ArrPrimitive(E.A) 55@ArrStr(E.A) 56@ArrEn(E.A) 57class EnC { } 58 59@Ann({@Override}) 60@Primitive({@Override}) 61@Str({@Override}) 62@En({@Override}) 63@ArrAnn({@Override}) 64@ArrPrimitive({@Override}) 65@ArrStr({@Override}) 66@ArrEn({@Override}) 67class ArrAnnC { } 68 69class ArrPrimitiveC { 70 private static final int C = 1; 71 @Ann({C}) 72 @Primitive({C}) 73 @Str({C}) 74 @En({C}) 75 @ArrAnn({C}) 76 @ArrPrimitive({C}) 77 @ArrStr({C}) 78 @ArrEn({C}) 79 class I { 80 } 81} 82 83class ArrStringC { 84 private static final String C = ""; 85 @Ann({C}) 86 @Primitive({C}) 87 @Str({C}) 88 @En({C}) 89 @ArrAnn({C}) 90 @ArrPrimitive({C}) 91 @ArrStr({C}) 92 @ArrEn({C}) 93 class I { 94 } 95} 96 97@Ann({E.A}) 98@Primitive({E.A}) 99@Str({E.A}) 100@En({E.A}) 101@ArrAnn({E.A}) 102@ArrPrimitive({E.A}) 103@ArrStr({E.A}) 104@ArrEn({E.A}) 105class ArrEnC { } 106 107@interface Ann { 108 Override value(); 109} 110 111@interface Primitive { 112 int value(); 113} 114 115@interface Str { 116 String value(); 117} 118 119@interface En { 120 E value(); 121} 122 123@interface ArrAnn { 124 Override[] value(); 125} 126 127@interface ArrPrimitive { 128 int[] value(); 129} 130 131@interface ArrStr { 132 String[] value(); 133} 134 135@interface ArrEn { 136 E[] value(); 137} 138 139enum E { 140 A; 141} 142