Logo Search packages:      
Sourcecode: jruby1.1 version File versions

IRubyObject org::jruby::RubyObject::rbClone (  )  [inline, inherited]


This method should be overridden only by: Proc, Method, UnboundedMethod, Binding. It will use the defined allocated of the object, then clone the singleton class, taint the object, call initCopy and then copy frozen state.

Implements org::jruby::runtime::builtin::IRubyObject.

Reimplemented in org::jruby::RubyMethod, org::jruby::RubyProc, and org::jruby::RubyUnboundMethod.

Definition at line 1312 of file RubyObject.java.

References org::jruby::RubyObject::setFrozen(), org::jruby::RubyObject::setMetaClass(), and org::jruby::RubyObject::setTaint().

        if (isImmediate()) throw getRuntime().newTypeError("can't clone " + getMetaClass().getName());
        // We're cloning ourselves, so we know the result should be a RubyObject
        RubyObject clone = (RubyObject)getMetaClass().getRealClass().allocate();
        if (isTaint()) clone.setTaint(true);

        initCopy(clone, this);

        if (isFrozen()) clone.setFrozen(true);
        return clone;

Generated by  Doxygen 1.6.0   Back to index