mv.visitJumpInsn(IFNE, next); // "if not zero, goto L (skip stuff)"
// first field accessor
mv.visitVarInsn(ALOAD, beanIndex); // load local for cast bean
mv.visitVarInsn(loadValueCode, 3);
AnnotatedField field = (AnnotatedField) props.get(0).getMember();
Type type = Type.getType(field.getRawType());
if (mustCast) {
mv.visitTypeInsn(CHECKCAST, type.getInternalName());
}
mv.visitFieldInsn(PUTFIELD, beanClass, field.getName(), type.getDescriptor());
mv.visitInsn(RETURN);
// And from this point on, loop a bit
for (int i = 1, len = props.size(); i < len; ++i) {
mv.visitLabel(next);
next = new Label();
mv.visitVarInsn(ILOAD, 2); // load second arg (index)
mv.visitInsn(ALL_INT_CONSTS[i]);
mv.visitJumpInsn(IF_ICMPNE, next);
mv.visitVarInsn(ALOAD, beanIndex); // load bean
mv.visitVarInsn(loadValueCode, 3);
field = (AnnotatedField) props.get(i).getMember();
type = Type.getType(field.getRawType());
if (mustCast) {
mv.visitTypeInsn(CHECKCAST, type.getInternalName());
}
mv.visitFieldInsn(PUTFIELD, beanClass, field.getName(), type.getDescriptor());
mv.visitInsn(RETURN);
}
mv.visitLabel(next);
}