MCPcopy Index your code
hub / github.com/antlr/codebuff / doDifference

Method doDifference

output/java_guava/1.4.19/Maps.java:505–520  ·  view source on GitHub ↗
(Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right, Equivalence<? super V> valueEquivalence, Map<K, V> onlyOnLeft, Map<K, V> onlyOnRight, Map<K, V> onBoth, Map<K, MapDifference.ValueDifference<V>> differences)

Source from the content-addressed store, hash-verified

503 }
504
505 private static <K, V> void doDifference(Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right, Equivalence<? super V> valueEquivalence, Map<K, V> onlyOnLeft, Map<K, V> onlyOnRight, Map<K, V> onBoth, Map<K, MapDifference.ValueDifference<V>> differences) {
506 for (Entry<? extends K, ? extends V> entry : left.entrySet()) {
507 K leftKey = entry.getKey();
508 V leftValue = entry.getValue();
509 if (right.containsKey(leftKey)) {
510 V rightValue = onlyOnRight.remove(leftKey);
511 if (valueEquivalence.equivalent(leftValue, rightValue)) {
512 onBoth.put(leftKey, leftValue);
513 } else {
514 differences.put(leftKey, ValueDifferenceImpl.create(leftValue, rightValue));
515 }
516 } else {
517 onlyOnLeft.put(leftKey, leftValue);
518 }
519 }
520 }
521
522 private static <K, V> Map<K, V> unmodifiableMap(Map<K, ? extends V> map) {
523 if (map instanceof SortedMap) {

Callers 1

differenceMethod · 0.95

Calls 8

createMethod · 0.95
entrySetMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65
containsKeyMethod · 0.65
removeMethod · 0.65
putMethod · 0.65
equivalentMethod · 0.45

Tested by

no test coverage detected