Clones @original and updates it's types - taken from @source.

@param original QueryParameters which would be updated
@param source   QueryParameters types of which would be read
@return updated clone on @original with updated types
14853
public static QueryParameters updateTypes(QueryParameters original, QueryParameters source) {
        QueryParameters updatedParams = new QueryParameters(original);
        Integer position = null;
        String originalKey = null;

        if (source != null) {
            for (String sourceKey : source.keySet()) {
                position = source.getFirstPosition(sourceKey);

                if (position != null) {
                    originalKey = original.getNameByPosition(position);
                    if (updatedParams.containsKey(originalKey) == true) {
                        updatedParams.updateType(originalKey, source.getType(sourceKey));
                    }
                }
            }
        }

        return updatedParams;
    }
201116
public void addPrimaryQuerySources(Collection<AliasedQuerySource> sources) {
        for (AliasedQuerySource source : sources) {
            internalAddQuerySource(source);
            if (source.getResultType() instanceof ListType) {
                isSingularValue = false;
            }
        }
    }
1211572
public static CmsContainerElementBean cloneWithFormatter(CmsContainerElementBean source, CmsUUID formatterId) {

        CmsContainerElementBean result = source.clone();
        result.m_formatterId = formatterId;
        return result;
    }
488205
public static PUBLISH copy(final PUBLISH original) {
        final PUBLISH publish = new PUBLISH();
        publish.setQoS(original.getQoS());
        publish.setRetain(original.isRetain());
        publish.setPayload(original.getPayload());
        publish.setTopic(original.getTopic());
        publish.setDuplicateDelivery(original.isDuplicateDelivery());
        publish.setMessageId(original.getMessageId());
        publish.setTTL(original.getTTL());
        return publish;
    }
893366
public EntityMapping addSource(EntityType source) {
    if (entityMappings.containsKey(source.getId())) {
      throw new IllegalStateException("Mapping already present for source " + source.getId());
    }
    EntityMapping result = new EntityMapping(source, target);
    entityMappings.put(source.getId(), result);
    return result;
  }
484739
public int updateByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes){
    	StringBuilder queryStr = new StringBuilder();
    	queryStr.append("update ")
			.append(this.clazz.getName())
			.append(" ");
    	if (secondHalfOfHql != null){
    		queryStr.append(secondHalfOfHql);
     	}
    	
        Session session = this.getCurrentSession();
    	Query query = session.createQuery(queryStr.toString());
    	setupQuery(query, paramValues, paramTypes, null, null);
        return query.executeUpdate();
    }
510039
public String getOriginalParams() {

        if (m_originalParams == null) {
            m_originalParams = CmsEncoder.decode(CmsRequestUtil.encodeParams(getJsp().getRequest()));
        }
        return m_originalParams;
    }
20163
public Replication queryParams(Map<String, Object> queryParams) {
        this.replication = replication.queryParams(queryParams);
        return this;
    }
113641
function clone(that, propName, value) {
    // immutable queries mean that we don't need to clone if no change in value.
    if (propName) {
      if (that[propName] === value) return that;
    }
    // copying QueryOptions is safe because they are are immutable;
    var copy = __extend(new EntityQuery(), that, [
      "resourceName",
      "fromEntityType",
      "wherePredicate",
      "orderByClause",
      "selectClause",
      "skipCount",
      "takeCount",
      "expandClause",
      "inlineCountEnabled",
      "noTrackingEnabled",
      "usesNameOnServer",
      "queryOptions",
      "entityManager",
      "dataService",
      "resultEntityType"
    ]);
    copy.parameters = __extend({}, that.parameters);
    if (propName) {
      copy[propName] = value;
    }
    return copy;
  }
963467
function cloneObject(source)
{
	var clone,key,value;
	
	if (Array.isArray(source) === true)
	{
		clone = [];
	}
	else
	{
		// Only clone the prototype -- more efficient as it will not convert keys to prototype keys
		clone = Object.create( Object.getPrototypeOf(source) );
	}
	
	// Clone keys/indexes
	// TODO :: use Object.keys() for more speed
	for (key in source)
	{
		if (hasOwnProperty.call(source, key) === true)
		{
			value = source[key];
			
			if (value!==null && typeof value==="object")
			{
				clone[key] = cloneObject(value);
			}
			else
			{
				clone[key] = value;
			}
		}
	}
	
	return clone;
}
1236588
def _clone(self):
        
        ubq = super(UpdateByQuery, self)._clone()

        ubq._response_class = self._response_class
        ubq._script = self._script.copy()
        ubq.query._proxied = self.query._proxied
        return ubq
1078697
private void cloneExportPoints(
        CmsModule sourceModule,
        CmsModule targetModule,
        String sourcePathPart,
        String targetPathPart) {

        for (CmsExportPoint exp : targetModule.getExportPoints()) {
            if (exp.getUri().contains(sourceModule.getName())) {
                exp.setUri(exp.getUri().replaceAll(sourceModule.getName(), targetModule.getName()));
            }
            if (exp.getUri().contains(sourcePathPart)) {
                exp.setUri(exp.getUri().replaceAll(sourcePathPart, targetPathPart));
            }
        }
    }
1350801
@SuppressWarnings({ "unchecked", "rawtypes" })
	public <T, I extends Serializable, D, J extends Serializable> RelationshipRepositoryStub<T, I, D, J> getQueryParamsRepository(Class<T> sourceClass, Class<D> targetClass) {
		init();

		RegistryEntry entry = resourceRegistry.findEntry(sourceClass);

		RelationshipRepositoryAdapter repositoryAdapter = entry.getRelationshipRepositoryForClass(targetClass, null);
		return (RelationshipRepositoryStub<T, I, D, J>) repositoryAdapter.getRelationshipRepository();
	}
1261979
@Override
    public void copyFrom(final CopyFrom obj) {
        final OpenSearchModule osm = (OpenSearchModule) obj;
        setTotalResults(osm.getTotalResults());
        setItemsPerPage(osm.getItemsPerPage());
        setStartIndex(osm.getStartIndex());
        setLink(osm.getLink());
        for (final OSQuery q : osm.getQueries()) {
            try {
                getQueries().add((OSQuery) q.clone());
            } catch (final CloneNotSupportedException e) {
                LOG.error("Error", e);
            }
        }
    }
63655
public MappingImpl cloneReadOnly(ConfigImpl config) {
	return new MappingImpl(config, virtual, strPhysical, strArchive, inspect, physicalFirst, hidden, true, topLevel, appMapping, ignoreVirtual, appListener, listenerMode,
		listenerType);
    }
364477
private T copyProperties(T source) {
        T target = createEmpty(source.getClass());

        Map<String, PropertyDescriptor> mapTargetProps = MappingUtils.mapPropertyDescriptors(target.getClass());
        Map<String, PropertyDescriptor> mapSourceProps = MappingUtils.mapPropertyDescriptors(source.getClass());

        Object value = null;

        for (String propertyName : mapSourceProps.keySet()) {
            value = MappingUtils.callGetter(source, mapSourceProps.get(propertyName));

            MappingUtils.callSetter(target, mapTargetProps.get(propertyName), value);
        }

        return target;
    }
632544
protected IntermediateQueryBuilder convertToBuilderAndTransform(IntermediateQuery originalQuery,
                                                                  HomogeneousQueryNodeTransformer nodeTransformer,
                                                                  DistinctVariableOnlyDataAtom transformedProjectionAtom) {
        IntermediateQueryBuilder queryBuilder = originalQuery.newBuilder();

        // Clone the original root node and apply the transformer if available.
        QueryNode originalRootNode = originalQuery.getRootNode();
        QueryNode newRootNode;
        newRootNode = originalRootNode.acceptNodeTransformer(nodeTransformer);
        queryBuilder.init(transformedProjectionAtom, newRootNode);
        return copyChildrenNodesToBuilder(originalQuery, queryBuilder, originalRootNode, newRootNode, nodeTransformer);
    }