private RubyClass findClass(String className) { return getClassFromPath(runtime, className); }
private RubyClass findClass(String className) { return getClassFromPath(runtime, className); }
private IRubyObject defaultObjectUnmarshal() throws IOException { RubySymbol className = (RubySymbol) unmarshalObject(false); RubyClass type = getClassFromPath(runtime, className.idString()); IRubyObject result = (IRubyObject)type.unmarshal(this); return result; }
private IRubyObject defaultObjectUnmarshal() throws IOException { RubySymbol className = (RubySymbol) unmarshalObject(false); RubyClass type = getClassFromPath(runtime, className.idString()); IRubyObject result = (IRubyObject)type.unmarshal(this); return result; }
public static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = RubyString.byteListToString(input.unmarshalString()); RubyClass result = UnmarshalStream.getClassFromPath(input.getRuntime(), name); input.registerLinkTarget(result); return result; }
public static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = RubyString.byteListToString(input.unmarshalString()); RubyClass result = UnmarshalStream.getClassFromPath(input.getRuntime(), name); input.registerLinkTarget(result); return result; }
public static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = RubyString.byteListToString(input.unmarshalString()); RubyClass result = UnmarshalStream.getClassFromPath(input.getRuntime(), name); input.registerLinkTarget(result); return result; }
public static RubyClass unmarshalFrom(UnmarshalStream input) throws java.io.IOException { String name = RubyString.byteListToString(input.unmarshalString()); RubyClass result = UnmarshalStream.getClassFromPath(input.getRuntime(), name); input.registerLinkTarget(result); return result; }
private IRubyObject defaultObjectUnmarshal() throws IOException { RubySymbol className = (RubySymbol) unmarshalObject(false); RubyClass type = null; try { type = getClassFromPath(runtime, className.toString()); } catch (RaiseException e) { if (runtime.getModule("NameError").isInstance(e.getException())) { throw runtime.newArgumentError("undefined class/module " + className.asJavaString()); } throw e; } assert type != null : "type shouldn't be null."; IRubyObject result = (IRubyObject)type.unmarshal(this); return result; }
private IRubyObject defaultObjectUnmarshal() throws IOException { RubySymbol className = (RubySymbol) unmarshalObject(false); RubyClass type = null; try { type = getClassFromPath(runtime, className.toString()); } catch (RaiseException e) { if (runtime.getModule("NameError").isInstance(e.getException())) { throw runtime.newArgumentError("undefined class/module " + className.asJavaString()); } throw e; } assert type != null : "type shouldn't be null."; IRubyObject result = (IRubyObject)type.unmarshal(this); return result; }
private IRubyObject uclassUnmarshall() throws IOException { RubySymbol className = (RubySymbol)unmarshalObject(false); RubyClass type = getClassFromPath(runtime, className.asJavaString()); // singleton, raise error if (type.isSingleton()) throw runtime.newTypeError("singleton can't be loaded"); // All "C" marshalled objects descend from core classes, which are all at least RubyObject RubyObject result = (RubyObject)unmarshalObject(); // if result is a module or type doesn't extend result's class... if (result.getMetaClass() == runtime.getModule() || !type.isKindOfModule(result.getMetaClass())) { // if allocators do not match, error // Note: MRI is a bit different here, and tests TYPE(type.allocate()) != TYPE(result) if (type.getAllocator() != result.getMetaClass().getRealClass().getAllocator()) { throw runtime.newArgumentError("dump format error (user class)"); } } result.setMetaClass(type); return result; }
private IRubyObject uclassUnmarshall() throws IOException { RubySymbol className = (RubySymbol)unmarshalObject(false); RubyClass type = getClassFromPath(runtime, className.asJavaString()); // singleton, raise error if (type.isSingleton()) throw runtime.newTypeError("singleton can't be loaded"); // All "C" marshalled objects descend from core classes, which are all at least RubyObject RubyObject result = (RubyObject)unmarshalObject(); // if result is a module or type doesn't extend result's class... if (result.getMetaClass() == runtime.getModule() || !type.isKindOfModule(result.getMetaClass())) { // if allocators do not match, error // Note: MRI is a bit different here, and tests TYPE(type.allocate()) != TYPE(result) if (type.getAllocator() != result.getMetaClass().getRealClass().getAllocator()) { throw runtime.newArgumentError("dump format error (user class)"); } } result.setMetaClass(type); return result; }