MCPcopy Create free account
hub / github.com/antlr/codebuff / difference

Method difference

corpus/java/training/guava/collect/Maps.java:428–437  ·  view source on GitHub ↗

Computes the difference between two maps. This difference is an immutable snapshot of the state of the maps at the time this method is called. It will never change, even if the maps change at a later time. Since this method uses HashMap instances internally, the keys of the supplied maps

(
      Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right)

Source from the content-addressed store, hash-verified

426 * @return the difference between the two maps
427 */
428 @SuppressWarnings("unchecked")
429 public static <K, V> MapDifference<K, V> difference(
430 Map<? extends K, ? extends V> left, Map<? extends K, ? extends V> right) {
431 if (left instanceof SortedMap) {
432 SortedMap<K, ? extends V> sortedLeft = (SortedMap<K, ? extends V>) left;
433 SortedMapDifference<K, V> result = difference(sortedLeft, right);
434 return result;
435 }
436 return difference(left, right, Equivalence.equals());
437 }
438
439 /**
440 * Computes the difference between two maps. This difference is an immutable

Callers

nothing calls this directly

Calls 8

equalsMethod · 0.95
checkNotNullMethod · 0.95
newLinkedHashMapMethod · 0.95
doDifferenceMethod · 0.95
orNaturalOrderMethod · 0.95
newTreeMapMethod · 0.95
comparatorMethod · 0.65
putAllMethod · 0.65

Tested by

no test coverage detected