@JRubyMethod
public IRubyObject set_value(IRubyObject object, IRubyObject value) {
Object javaObject = JavaUtil.unwrapJavaValue(getRuntime(), object, "not a java object: " + object);
IRubyObject val = value;
if(val.dataGetStruct() instanceof JavaObject) {
val = (IRubyObject)val.dataGetStruct();
}
try {
Object convertedValue = JavaUtil.convertArgumentToType(val.getRuntime().getCurrentContext(), val, field.getType());
field.set(javaObject, convertedValue);