// if (${cmrField.name}.equals(arg1))
mv.visitLdcInsn(cmrField.getName());
mv.visitVarInsn(ALOAD, 1);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/String", "equals", "(Ljava/lang/Object;)Z");
// if not equal jump to end
Label end = new Label();
mv.visitJumpInsn(IFEQ, end);
// collection style relationship. Generate the code to add this object to the
// collection already anchored in the CMR field.
if (cmrField.getCmrStyle() != CmrStyle.SINGLE) {
mv.visitVarInsn(ALOAD, 0);
mv.visitFieldInsn(GETFIELD, implClassName, cmrField.getName(), cmrField.getDescriptor());
mv.visitVarInsn(ASTORE, 3);
mv.visitVarInsn(ALOAD, 3);
Label fieldNotNull = new Label();
mv.visitJumpInsn(IFNONNULL, fieldNotNull);
// lazy creation of the collection type if not already created.
mv.visitTypeInsn(NEW, cmrField.getInitialValueType().getInternalName());
mv.visitInsn(DUP);
mv.visitMethodInsn(INVOKESPECIAL, cmrField.getInitialValueType().getInternalName(), "<init>", "()V");