/*
Copy over non-hal properties (everything that is not _links or _embedded)
to the parsed resource.
339342
function copyNonHalProperties(unparsed, resource) {
  Object.keys(unparsed).forEach(function(key) {
    if (key !== '_links' && key !== '_embedded') {
      resource[key] = unparsed[key];
    }
  });
}
1260842
function copyOwnProperties(source, target, ignorePropertyNames = []) {
  Object.getOwnPropertyNames(source).forEach(name => {
    if (ignorePropertyNames.indexOf(name) < 0) {
      const descriptor = Object.getOwnPropertyDescriptor(source, name);
      Object.defineProperty(target, name, descriptor);
    }
  });
  return target;
}
1207214
@Resource(name = "nonNamespacedPortletProperties")
    public void setNonNamespacedProperties(Set<String> nonNamespacedProperties) {
        this.nonNamespacedProperties = ImmutableSet.copyOf(nonNamespacedProperties);
    }
883812
public static StringBuilder replaceResources(StringBuilder sb, ResourceBundle reg, Map<String, Object> map, PropertyOwner propertyOwner, boolean systemProperties)
    {
    	boolean bDoubleBraces = false;
        int index = 0;
        while (index < sb.length())
        {
            int iStartBrace = sb.indexOf("{", index);
            if (iStartBrace == -1)
                break;
            if (iStartBrace + 1 < sb.length())
            	if (sb.charAt(iStartBrace + 1) == '{')
        	{
            	bDoubleBraces = true;
            	index = iStartBrace + 2;
            	continue;
        	}
            int iEndBrace = sb.indexOf("}", iStartBrace);
            if (iEndBrace == -1)
                break;
            String strKey = sb.substring(iStartBrace + 1, iEndBrace);
            if (iStartBrace > 0)
            	if (sb.charAt(iStartBrace - 1) == '$')
            		iStartBrace--;
            String string = null;
            if (map != null)
            	if (map.get(strKey) != null)
            		string = map.get(strKey).toString();
            if (reg != null)
                if (string == null)
                    string = reg.getString(strKey);
            if (propertyOwner != null)
                if (string == null)
                    string = propertyOwner.getProperty(strKey);
            if (string == null)
                if (systemProperties)
                    try {
                        string = System.getProperty(strKey);
                    } catch (Exception e) { // Ignore (security) errors
                    }
            if (string == null)
                string = strKey;    // Never
            sb.replace(iStartBrace, iEndBrace + 1, string);
            index = index + string.length();
        }
        if (bDoubleBraces)
        {
            index = 0;
            while (index < sb.length() - 1)
            {
            	index = sb.indexOf("{{", index);
            	if (index == -1)
            		break;
    			sb.replace(index, index + 2, "{");
            	index = sb.indexOf("}}", index);
            	if (index == -1)
            		break;
    			sb.replace(index, index + 2, "}");
            }
        }
        return sb;
    }
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;
  }
265159
function cloneRelayHandleSourceField(
  handleField: NormalizationLinkedHandle,
  selections: $ReadOnlyArray<NormalizationSelection>,
  variables: Variables,
): NormalizationLinkedField {
  const sourceField = selections.find(
    source =>
      source.kind === LINKED_FIELD &&
      source.name === handleField.name &&
      source.alias === handleField.alias &&
      areEqual(source.args, handleField.args),
  );
  invariant(
    sourceField && sourceField.kind === LINKED_FIELD,
    'cloneRelayHandleSourceField: Expected a corresponding source field for ' +
      'handle `%s`.',
    handleField.handle,
  );
  const handleKey = getHandleStorageKey(handleField, variables);
  const clonedField = {
    ...sourceField,
    args: null,
    name: handleKey,
    storageKey: handleKey,
  };
  return clonedField;
}
357755
public static void copyProperties(Object source, Object target, String... ignoreProperties) {
		copyProperties(source, target, CopyOptions.create().setIgnoreProperties(ignoreProperties));
	}
813148
public static void copyResource(String resource, File destination) throws IOException {
        InputStream is = null;
        FileOutputStream fos = null;

        try {
            is = FileUtils.class.getResourceAsStream("/" + resource);
            fos = new FileOutputStream(destination);

            final byte[] buffer = new byte[10 * 1024];
            int len;
            while ((len = is.read(buffer)) > 0) {
                fos.write(buffer, 0, len);
            }
        } finally {
            close(is);
            close(fos);
        }

    }
1000133
function copySourceContent(filename) {
    var content = consumer.sourceContentFor(filename);
    if (content) {
      generator.setSourceContent(filename, content);
    }
  }
780121
protected void copyFieldsFrom(RepositoryResourceImpl fromResource, boolean includeAttachmentInfo) {
        setName(fromResource.getName()); // part of the identification so locked
        setDescription(fromResource.getDescription());
        setShortDescription(fromResource.getShortDescription());
        setProviderName(fromResource.getProviderName()); // part of the identification so locked
        setProviderUrl(fromResource.getProviderUrl());
        setVersion(fromResource.getVersion());
        setDownloadPolicy(fromResource.getDownloadPolicy());
        setLicenseId(fromResource.getLicenseId());
        setLicenseType(fromResource.getLicenseType());
        setMainAttachmentSize(fromResource.getMainAttachmentSize());
        setMainAttachmentSHA256(fromResource.getMainAttachmentSHA256());
        setFeaturedWeight(fromResource.getFeaturedWeight());
        setDisplayPolicy(fromResource.getDisplayPolicy());
        setVanityURL(fromResource.getVanityURL());
        setWlpInformationVersion(fromResource.getWlpInformationVersion());
        setMavenCoordinates(fromResource.getMavenCoordinates());

        if (includeAttachmentInfo) {
            setMainAttachmentSize(fromResource.getMainAttachmentSize());
        }
        _asset.getWlpInformation().setAppliesToFilterInfo(fromResource.getAsset().getWlpInformation().getAppliesToFilterInfo());
    }
828494
function copyProperties (source, destination) {
  var props = Object.getOwnPropertyNames(source);
  props.forEach(function (prop) {
    var desc;
    if (!destination[prop]) {
      desc = Object.getOwnPropertyDescriptor(source, prop);
      destination[prop] = {value: source[prop], writable: desc.writable};
    }
  });
}
315737
function clone (thing) {
  var copy = {};
  var value;

  for (var key in thing) {
    value = thing[key];

    if (!value) {
      copy[key] = value;
    } else if (momentum.isMoment(value)) {
      copy[key] = value.clone();
    } else if (value._isStylesConfiguration) {
      copy[key] = clone(value);
    } else {
      copy[key] = value;
    }
  }

  return copy;
}
771886
function copyOwn(source, target, inherits, publicStatic, allowInit, isNOTExtendingNative) {
    for (var
      key,
      noFunctionCheck = typeof source !== 'function',
      names = oK(source),
      i = 0; i < names.length; i++
    ) {
      key = names[i];
      if (
        (noFunctionCheck || indexOf.call(nativeFunctionOPN, key) < 0) &&
        isNotASpecialKey(key, allowInit)
      ) {
        if (hOP.call(target, key)) {
          warn('duplicated: ' + key.toString());
        }
        setProperty(inherits, target, key, gOPD(source, key), publicStatic, isNOTExtendingNative);
      }
    }
  }
1102525
public Set<Reference> getNonCopytoResult() {
        final Set<Reference> nonCopytoSet = new LinkedHashSet<>(128);

        nonCopytoSet.addAll(nonConrefCopytoTargets);
        for (final URI f : conrefTargets) {
            nonCopytoSet.add(new Reference(stripFragment(f), currentFileFormat()));
        }
        for (final URI f : copytoMap.values()) {
            nonCopytoSet.add(new Reference(stripFragment(f)));
        }
        for (final URI f : ignoredCopytoSourceSet) {
            nonCopytoSet.add(new Reference(stripFragment(f)));
        }
        for (final URI filename : coderefTargetSet) {
            nonCopytoSet.add(new Reference(stripFragment(filename)));
        }
        return nonCopytoSet;
    }
1231968
public final static void copyProperties(Object from, Object to) {

        Set<Field> fromSet = getAllFiled(from.getClass());
        Set<Field> toSet = getAllFiled(to.getClass());

        Map<String, Field> toMap = new HashMap<String, Field>();
        for (Field f : toSet) {
            toMap.put(f.getName(), f);
        }

        for (Field f : fromSet) {
            if (Modifier.isStatic(f.getModifiers())) {
                continue;
            }
            String name = f.getName();
            Field toField = toMap.get(name);
            if (toField == null) {
                continue;
            }

            toField.setAccessible(true);
            f.setAccessible(true);
            try {
                toField.set(to, f.get(from));
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }

    }
16508
function clone(source) {
    var ret = {};
    for (var prop in source) {
      ret[prop] = source[prop];
    }
    return ret;
  }
1366981
public static void copyExternalAssets(AbstractWisdomMojo mojo, MavenResourcesFiltering filtering) throws IOException {
        File in = new File(mojo.basedir, Constants.ASSETS_SRC_DIR);
        if (!in.exists()) {
            return;
        }
        File out = new File(mojo.getWisdomRootDirectory(), Constants.ASSETS_DIR);
        filterAndCopy(mojo, filtering, in, out);
    }