You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The comparison of two SortedSets or SortedMaps with deepEquals does not work as expected, when the SortedSets or SortedMaps are not using the same comparator for ordering the elements. If not the same comparators are used, the method returns wrong results, as the iterators i1 and i2 used in compareOrderedCollection and compareSortedMap return elements in a different order.
With the default implementation of equals, this is not the case:
In the JDK, the equals method of Sets and Maps does not consider the ordering in any case, even for SortedSets and SortedMaps. Instead SortedSets are considered to be equal to Sets (and respectively for Maps) when they contain exactly the same entries:
Can you verify DeepEquals.deepEquals() works correctly for you? The issue was tied to DeepEquals as far as I recall. I realize you are talking about GraphComparator here. We will take a look at that as it should have same behavior as DeepEquals.
The comparison of two
SortedSet
s orSortedMap
s withdeepEquals
does not work as expected, when theSortedSet
s orSortedMap
s are not using the same comparator for ordering the elements. If not the same comparators are used, the method returns wrong results, as the iteratorsi1
andi2
used incompareOrderedCollection
andcompareSortedMap
return elements in a different order.With the default implementation of
equals
, this is not the case:In the JDK, the
equals
method ofSet
s andMap
s does not consider the ordering in any case, even forSortedSet
s andSortedMap
s. InsteadSortedSet
s are considered to be equal toSet
s (and respectively forMap
s) when they contain exactly the same entries:Whereas
deepEquals
considers those twoSet
s to be not equal, because they are not both of the typeSortedSet
s.The text was updated successfully, but these errors were encountered: