field.setObjectValue(object, value); } else if (type.isCharType()) { field.setCharValue(object, VM_Reflection.unwrapChar(value)); } else if (type.isDoubleType()) { field.setDoubleValue(object, VM_Reflection.unwrapDouble(value)); } else if (type.isFloatType()) { field.setFloatValue(object, VM_Reflection.unwrapFloat(value)); } else if (type.isLongType()) { field.setLongValue(object, VM_Reflection.unwrapLong(value)); } else if (type.isIntType()) { field.setIntValue(object, VM_Reflection.unwrapInt(value)); } else if (type.isShortType()) { field.setShortValue(object, VM_Reflection.unwrapShort(value)); } else if (type.isByteType()) { field.setByteValue(object, VM_Reflection.unwrapByte(value)); } else if (type.isBooleanType()) { field.setBooleanValue(object, VM_Reflection.unwrapBoolean(value));
VM_Type valueType = VM_ObjectModel.getObjectType(value); VM_Type fieldType; try { fieldType = type.resolve(); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("field type mismatch"); } if (fieldType != valueType && !VM_Runtime.isAssignableWith(fieldType, valueType)) { throw new IllegalArgumentException("field type mismatch"); } field.setObjectValueUnchecked(object, value); } else if (value instanceof Character) { setCharInternal(object, ((Character)value).charValue()); } else if (value instanceof Double) { setDoubleInternal(object, ((Double)value).doubleValue()); } else if (value instanceof Float) { setFloatInternal(object, ((Float)value).floatValue()); } else if (value instanceof Long) { setLongInternal(object, ((Long)value).longValue()); } else if (value instanceof Integer) { setIntInternal(object, ((Integer)value).intValue()); } else if (value instanceof Short) { setShortInternal(object, ((Short)value).shortValue()); } else if (value instanceof Byte) { setByteInternal(object, ((Byte)value).byteValue()); } else if (value instanceof Boolean) { setBooleanInternal(object, ((Boolean)value).booleanValue()); } else { throw new IllegalArgumentException("field type mismatch");
  public void set(Object object, Object value)     throws IllegalAccessException, IllegalArgumentException     {    checkWriteAccess(object);    VM_TypeReference type = field.getType();    if (type.isReferenceType()) {      field.setObjectValue(object, value);    } else if (type.isCharType()) {      field.setCharValue(object, VM_Reflection.unwrapChar(value));    } else if (type.isDoubleType()) {      field.setDoubleValue(object, VM_Reflection.unwrapDouble(value));    } else if (type.isFloatType()) {      field.setFloatValue(object, VM_Reflection.unwrapFloat(value));    } else if (type.isLongType()) {      field.setLongValue(object, VM_Reflection.unwrapLong(value));    } else if (type.isIntType()) {      field.setIntValue(object, VM_Reflection.unwrapInt(value));    } else if (type.isShortType()) {      field.setShortValue(object, VM_Reflection.unwrapShort(value));    } else if (type.isByteType()) {      field.setByteValue(object, VM_Reflection.unwrapByte(value));    } else if (type.isBooleanType()) {      field.setBooleanValue(object, VM_Reflection.unwrapBoolean(value));    }  }