Adds the values from a {@code TernaryVector} to an {@code IntegerVector}.
Only the positive and negative indices will be traversed to save time.

@param destination The vector to write new values to.
@param source The vector to read values from.
359865
private static void addTernaryValues(IntegerVector destination,
                                         TernaryVector source) {
        for (int p : source.positiveDimensions())
            destination.add(p, 1);
        for (int n : source.negativeDimensions())
            destination.add(n, -1);
    }
488025
private function makeArrayFromOptionsWithVoidValues(array $source, array &$destination): array
    {
        $destination = [];

        foreach ($source as $option) {
            $destination[trim($option, "- ")] = "";
        }

        return $destination;
    }
242662
public void set(Vector2f start, Vector2f end) {
		super.pointsDirty = true;
		if (this.start == null) {
			this.start = new Vector2f();
		}
		this.start.set(start);

		if (this.end == null) {
			this.end = new Vector2f();
		}
		this.end.set(end);

		vec = new Vector2f(end);
		vec.sub(start);

		lenSquared = vec.lengthSquared();
	}
1118313
@Override
    public void copyObject(final FedoraSession session, final String source, final String destination) {
        final Session jcrSession = getJcrSession(session);
        try {
            jcrSession.getWorkspace().copy(source, destination);
            touchLdpMembershipResource(getJcrNode(find(session, destination)));
        } catch (final RepositoryException e) {
            throw new RepositoryRuntimeException(e);
        }
    }
762275
Number numberFor(Number source, Class<?> destinationType) {
    if (destinationType.equals(source.getClass()))
      return source;

    if (destinationType.equals(Byte.class)) {
      long longValue = source.longValue();
      if (longValue > Byte.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Byte.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Byte.valueOf(source.byteValue());
    }

    if (destinationType.equals(Short.class)) {
      long longValue = source.longValue();
      if (longValue > Short.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Short.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Short.valueOf(source.shortValue());
    }

    if (destinationType.equals(Integer.class)) {
      long longValue = source.longValue();
      if (longValue > Integer.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      if (longValue < Integer.MIN_VALUE)
        throw new Errors().errorTooSmall(source, destinationType).toMappingException();
      return Integer.valueOf(source.intValue());
    }

    if (destinationType.equals(Long.class))
      return Long.valueOf(source.longValue());

    if (destinationType.equals(Float.class)) {
      if (source.doubleValue() > Float.MAX_VALUE)
        throw new Errors().errorTooLarge(source, destinationType).toMappingException();
      return Float.valueOf(source.floatValue());
    }

    if (destinationType.equals(Double.class))
      return Double.valueOf(source.doubleValue());

    if (destinationType.equals(BigDecimal.class)) {
      if (source instanceof Float || source instanceof Double)
        return new BigDecimal(source.toString());
      else if (source instanceof BigInteger)
        return new BigDecimal((BigInteger) source);
      else
        return BigDecimal.valueOf(source.longValue());
    }

    if (destinationType.equals(BigInteger.class)) {
      if (source instanceof BigDecimal)
        return ((BigDecimal) source).toBigInteger();
      else
        return BigInteger.valueOf(source.longValue());
    }

    throw new Errors().errorMapping(source, destinationType).toMappingException();
  }
1346224
static Entry makeEntry(byte[] source, byte[] destination) {
        CaseInsensitiveBytesHash<Entry> sHash = transcoders.get(source);
        if (sHash == null) {
            sHash = new CaseInsensitiveBytesHash<Entry>();
            transcoders.putDirect(source, sHash);
        }
        Entry entry = sHash.get(destination);
        if (entry == null) {
            entry = new Entry(source, destination);
            sHash.putDirect(destination, entry);
        } else {
            throw new TranscoderException(ErrorMessages.ERR_TRANSCODER_ALREADY_REGISTERED, new String(source + " to " + new String(destination)));
        }

        return entry;
    }
223851
protected void copyErrors(ActionBeanContext source, ActionBeanContext destination) {
        destination.getValidationErrors().putAll(source.getValidationErrors());
    }
279708
Number numberFor(String source, Class<?> destinationType) {
    String sourceString = source.trim();
    if (sourceString.length() == 0)
      return null;

    try {
      if (destinationType.equals(Byte.class))
        return Byte.valueOf(source);
      if (destinationType.equals(Short.class))
        return Short.valueOf(source);
      if (destinationType.equals(Integer.class))
        return Integer.valueOf(source);
      if (destinationType.equals(Long.class))
        return Long.valueOf(source);
      if (destinationType.equals(Float.class))
        return Float.valueOf(source);
      if (destinationType.equals(Double.class))
        return Double.valueOf(source);
      if (destinationType.equals(BigDecimal.class))
        return new BigDecimal(source);
      if (destinationType.equals(BigInteger.class))
        return new BigInteger(source);
    } catch (Exception e) {
      throw new Errors().errorMapping(source, destinationType, e).toMappingException();
    }

    throw new Errors().errorMapping(source, destinationType).toMappingException();
  }
312156
private boolean copy(InputStream source, String destination) {
        boolean success = true;

        try
        {
            Files.copy(source, Paths.get(destination), StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException ex)
        {
            LOG.fatal("Cannot write file " + destination, ex);
            success = false;
        }

        return success;
    }
848646
private static void add(IntegerVector semantics, TernaryVector index) {
        // Lock on the semantic vector to avoid a race condition with another
        // thread updating its semantics.  Use the vector to avoid a class-level
        // lock, which would limit the concurrency.
        synchronized(semantics) {
            for (int p : index.positiveDimensions())
                semantics.add(p, 1);
            for (int n : index.negativeDimensions())
                semantics.add(n, -1);
        }
    }
407054
public void writeTo(Writer destination) {
        Element eltRuleset = new Element("ruleset");
        addAttribute(eltRuleset, "name", name);
        addChild(eltRuleset, "description", description);
        for (PmdRule pmdRule : rules) {
            Element eltRule = new Element("rule");
            addAttribute(eltRule, "ref", pmdRule.getRef());
            addAttribute(eltRule, "class", pmdRule.getClazz());
            addAttribute(eltRule, "message", pmdRule.getMessage());
            addAttribute(eltRule, "name", pmdRule.getName());
            addAttribute(eltRule, "language", pmdRule.getLanguage());
            addChild(eltRule, "priority", String.valueOf(pmdRule.getPriority()));
            if (pmdRule.hasProperties()) {
                Element ruleProperties = processRuleProperties(pmdRule);
                if (ruleProperties.getContentSize() > 0) {
                    eltRule.addContent(ruleProperties);
                }
            }
            eltRuleset.addContent(eltRule);
        }
        XMLOutputter serializer = new XMLOutputter(Format.getPrettyFormat());
        try {
            serializer.output(new Document(eltRuleset), destination);
        } catch (IOException e) {
            throw new IllegalStateException("An exception occurred while serializing PmdRuleSet.", e);
        }
    }
58659
public void copyValuesFromTo(Collection<Object> source, List<Object> target) {
        target.addAll(source);
    }
665451
public static DataBinding map( Object source, Object destination )
	{
		return bindObject( source ).mapTo( destination );
	}
1162832
public void add(IVector b, IVector result) {
        if ((b == null) || (size != b.size)) return;

        if (result.size != size) result.reshape(size);

        int i;
        for (i = 0; i < size; i++) {
            result.realvector[i] = realvector[i] + b.realvector[i];
            result.imagvector[i] = imagvector[i] + b.imagvector[i];
        }
    }
984812
function (destination, source) {
            _gpfIgnore(source);
            _gpfArrayTail(arguments).forEach(function (nthSource) {
                _gpfObjectForEach(nthSource, _gpfObjectAssign, destination);
            });
            return destination;
        }
240798
@Override
  public B writeTo(Destination destination) {
    super.writeTo(destination);
    fromState(destination.getProperties());
    return typedSelf();
  }
976339
private void twoWayMergeInternalStandard(final ReservoirLongsSketch source) {
    assert (source.getN() <= source.getK());
    final int numInputSamples = source.getNumSamples();
    for (int i = 0; i < numInputSamples; ++i) {
      gadget_.update(source.getValueAtPosition(i));
    }
  }