private void generatePrimitiveWriter(CodeVisitor cw,
                                       Method method,
                                       String className)
  {
    String fieldName = makeFieldName(method);
    Class type = getClassOfMethodSubject(method);
    cw.visitVarInsn(ALOAD, 0);
    if (type == int.class ||
        type == boolean.class ||
        type == char.class ||
        type == short.class ||
        type == byte.class) {
      cw.visitVarInsn(ILOAD, 1);
    }
    else if (type == long.class) {
      cw.visitVarInsn(LLOAD, 1);
    }
    else if (type == float.class) {
      cw.visitVarInsn(FLOAD, 1);
    }
    else if (type == double.class) {
      cw.visitVarInsn(DLOAD, 1);
    }
    cw.visitFieldInsn(PUTFIELD, className, fieldName, Type.getDescriptor(type));
    cw.visitInsn(RETURN);
    cw.visitMaxs(0, 0);
  }