Replace the state of this object with the same object in some other state.
Used for to restore the before image if a transaction rolls back.
@param other is the object this object is to become a clone of.
420014
public void becomeCloneOf(ManagedObject clone)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "becomeCloneOf", "Clone="+clone);

        PersistableSlicedData object = (PersistableSlicedData)clone;

        _dataSlices = object._dataSlices;

        _estimatedLength = -1;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "becomeCloneOf");
    }
443104
def restore(self, state):
        '''

        '''
        self.a = np.array(state['a']).copy()
        self.b = np.array(state['b']).copy()
        self.c = np.array(state['c']).copy()
        self.pivot = np.array(state['pivot']).copy()
        self.position = np.array(state['position']).copy()
1214436
public void union(final HLL other) {
        // TODO: verify HLLs are compatible
        final HLLType otherType = other.getType();

        if(type.equals(otherType)) {
            homogeneousUnion(other);
            return;
        } else {
            heterogenousUnion(other);
            return;
        }
    }
782522
public void copyFrom(BlockType other) {
        this.isValid = other.isValid;
        this.isTop = other.isTop;
        if (isValid) {
            this.depth = other.depth;
            this.clear();
            this.or(other);
        }
    }
914366
public function copyTo(LayerManager $other) 
    {
        $other->color = $this->color;
        
        $layer = $this->topLayer;
        $previousCopy = null;
        
        while ($layer !== null) {
            $copy = new Layer(
                $layer->polygonId,
                $layer->color,
                $layer->winding,
                $layer->windingRule
                );
            
            if ($previousCopy === null) {
                $other->topLayer = $copy;
            }
            else {
                $previousCopy->nextLayer = $copy;
            }
            
            $previousCopy = $copy;
            $layer = $layer->nextLayer;
        }
    }
1206926
public void copyFrom(Model other) {
        if (!metaModelLocal.getTableName().equals(other.metaModelLocal.getTableName())) {
            throw new IllegalArgumentException("can only copy between the same types");
        }
        Map<String, Object> otherAttributes = other.getAttributes();
        for (String name : metaModelLocal.getAttributeNamesSkipId()) {
            attributes.put(name, otherAttributes.get(name));
            dirtyAttributeNames.add(name);
            // Why not use setRaw() here? Does the same and avoids duplication of code... (Garagoth)
            // other.setRaw(name, getRaw(name));
        }
    }
1112659
private void changeStateTo(int newState) {
    synchronized (lockObject) {
      int oldState = this.status.getRunState();
      if (oldState == newState) {
        return; //old and new states are same
      }
      this.status.setRunState(newState);
    }
  }
518359
def replace_with(self, other):
        """"""
        self.after(other)
        self.parent.pop(self._own_index)
        return other
56640
def initialize_copy(other)
      @fields = {}

      self.type = other.type
      self.key = other.key

      add(other.fields)
    end
825516
public void mergeWith(BlockType other) {
        if (this.isTop() || other.isBottom()) {
            copyFrom(other);
        } else if (isValid()) {
            // To merge, we take the common prefix
            int pfxLen = Math.min(this.depth, other.depth);
            int commonLen;
            for (commonLen = 0; commonLen < pfxLen; ++commonLen) {
                if (this.get(commonLen) != other.get(commonLen)) {
                    break;
                }
            }
            this.depth = commonLen;
        }
    }
1022177
public void assign(AbstractIntDoubleMap other) {
	if (!(other instanceof OpenIntDoubleHashMap)) {
		super.assign(other);
		return;
	}
	OpenIntDoubleHashMap source = (OpenIntDoubleHashMap) other;
	OpenIntDoubleHashMap copy = (OpenIntDoubleHashMap) source.copy();
	this.values = copy.values;
	this.table = copy.table;
	this.state = copy.state;
	this.freeEntries = copy.freeEntries;
	this.distinct = copy.distinct;
	this.lowWaterMark = copy.lowWaterMark;
	this.highWaterMark = copy.highWaterMark;
	this.minLoadFactor = copy.minLoadFactor;
	this.maxLoadFactor = copy.maxLoadFactor;
}
306258
public void setState(TransferState state) {
        synchronized (this) {
            this.state = state;
        }
        for ( TransferStateChangeListener listener : stateChangeListeners ) {
            listener.transferStateChanged(this, state);
        }
    }
1096372
protected void saveClonedState(Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "saveClonedState";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, transaction);

        // Loop over all of the ObjecStores.
        java.util.Iterator objectStoreIterator = objectStores.values()
                        .iterator();
        while (objectStoreIterator.hasNext()) {
            ObjectStore objectStore = (ObjectStore) objectStoreIterator.next();

            // Don't bother with ObjectStores that can't be used for recovery.
            if (objectStore.getContainsRestartData()) {

                // Locate any existing copy.
                Token objectManagerStateCloneToken = new Token(objectStore,
                                                               ObjectStore.objectManagerStateIdentifier.longValue());
                // Swap for the definitive Token, if there is one.
                objectManagerStateCloneToken = objectStore.like(objectManagerStateCloneToken);

                ObjectManagerState objectManagerStateClone = (ObjectManagerState) objectManagerStateCloneToken.getManagedObject();

                // Does the cloned state already exist?
                if (objectManagerStateClone == null) {
                    objectManagerStateClone = new ObjectManagerState();
                    objectManagerStateClone.objectStores = objectStores;
                    objectManagerStateClone.becomeCloneOf(this);
                    objectManagerStateCloneToken.setManagedObject(objectManagerStateClone);
                    transaction.add(objectManagerStateClone);

                } else {
                    transaction.lock(objectManagerStateClone);
                    objectManagerStateClone.objectStores = objectStores;
                    objectManagerStateClone.becomeCloneOf(this);
                    transaction.replace(objectManagerStateClone);
                } //  if (objectManagerStateClone == null).
            } // if (objectStore.getContainsRestartData()).
        } // While objectStoreIterator.hasNext().

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
494024
public void becomeCloneOf(ManagedObject other)
    {
        Anchor o = (Anchor)other;
        _rootStreamToken = o._rootStreamToken;
        _uniqueKeyTableToken = o._uniqueKeyTableToken;
    }
713733
public void copyFrom(PolicyInfo other) {
    if (other.conf != null) {
      this.conf = other.conf;
    }
    if (other.policyName != null && other.policyName.length() > 0) {
      this.policyName = other.policyName;
    }
    if (other.description != null && other.description.length() > 0) {
      this.description = other.description;
    }
    if (other.codecId != null) {
      this.codecId = other.codecId;
    }
    if (other.srcPath != null) {
      this.srcPath = other.srcPath;
    }
    if (other.fileListPath != null) {
      this.fileListPath = other.fileListPath;
    }
    for (Object key : other.properties.keySet()) {
      String skey = (String) key;
      this.properties.setProperty(skey, other.properties.getProperty(skey));
    }
    LOG.info(this.policyName + ".codecId " + codecId);
    LOG.info(this.policyName + ".fileListPath " + fileListPath);
    LOG.info(this.policyName + ".srcpath " + srcPath);
  }
601187
def +(other)
	    return self.clone unless other

	    case other
		when Array, Vector
		    if @translation
			Transformation.new(@translation+other, @rotation, @scale)
		    else
			Transformation.new(other, @rotation, @scale)
		    end
		when Composition
		    Composition.new(self, *other.transformations)
		when Transformation
		    if @rotation || other.rotation
			Composition.new(self, other)
		    else
			translation = @translation ? (@translation + other.translation) : other.translation
			Transformation.new(translation, @rotation, @scale)
		    end
	    end
	end
613567
public void copyFrom(PointerCoords other) {
        final long bits = other.mPackedAxisBits;
        mPackedAxisBits = bits;
        if (bits != 0) {
            final float[] otherValues = other.mPackedAxisValues;
            final int count = Long.bitCount(bits);
            float[] values = mPackedAxisValues;
            if (values == null || count > values.length) {
                values = new float[otherValues.length];
                mPackedAxisValues = values;
            }
            System.arraycopy(otherValues, 0, values, 0, count);
        }

        x = other.x;
        y = other.y;
        pressure = other.pressure;
        size = other.size;
        touchMajor = other.touchMajor;
        touchMinor = other.touchMinor;
        toolMajor = other.toolMajor;
        toolMinor = other.toolMinor;
        orientation = other.orientation;
    }