@@ -201,11 +201,10 @@ public void visitMethodInsn(int opcode, String owner, String name, String descri
201201 if (isFirstParamLoad ) {
202202 Type returnType = getReturnType (descriptor );
203203 if (isArray (returnType )) {
204- @ SuppressWarnings ("unchecked" )
205- List <EnumEntry > annotationValues = (List <EnumEntry >) targetParam
204+ EnumerationDescription [] annotationValues = (EnumerationDescription []) targetParam
206205 .annotationValue (currentAnnotationType , name );
207206 writeArray (returnType .getElementType (),
208- annotationValues == null ? emptyList () : annotationValues );
207+ annotationValues == null ? emptyList () : Arrays . asList ( annotationValues ) );
209208 } else {
210209 visitLdcInsn (annotationsLdcInsnValue (targetParam , owner , name , returnType ));
211210 }
@@ -216,18 +215,18 @@ public void visitMethodInsn(int opcode, String owner, String name, String descri
216215 }
217216 }
218217
219- private void writeArray (Type arrayElementType , List <EnumEntry > annotationValues ) {
218+ private void writeArray (Type arrayElementType , List <EnumerationDescription > annotationValues ) {
220219 int intInsn = annotationValues .size () <= 127 ? BIPUSH : SIPUSH ;
221220 mv .visitIntInsn (intInsn , annotationValues .size ());
222221 // TODO this only works for objects but not primitive arrays
223222 mv .visitTypeInsn (ANEWARRAY , arrayElementType .getInternalName ());
224223
225224 int idx = 0 ;
226- for (EnumEntry entry : annotationValues ) {
225+ for (EnumerationDescription entry : annotationValues ) {
227226 mv .visitInsn (DUP );
228227 mv .visitIntInsn (intInsn , idx ++);
229- mv .visitFieldInsn (GETSTATIC , entry .type ().getInternalName (), entry .value (),
230- entry .type ().getDescriptor ());
228+ mv .visitFieldInsn (GETSTATIC , entry .getEnumerationType ().getInternalName (), entry .getValue (),
229+ entry .getEnumerationType ().getDescriptor ());
231230 mv .visitInsn (AASTORE );
232231 }
233232 }
0 commit comments