-
Bug
-
Resolution: Fixed
-
P4
-
1.2.2
-
rc1
-
generic
-
generic
1) Comparator:
"A class's natural ordering is said to be consistent with equals if
and only if (e1.compareTo((Object)e2)==0) has the same boolean value
as e1.equals((Object)e2) for every e1 and e2 of class C."
This part of the spec should be clarified as follows:
A class's natural ordering is said to be consistent with equals if
and only if (e1.compareTo((Object)e2)==0) has the same boolean value
as e1.equals((Object)e2) for every e1 and e2 of class C for which the
former expression is defined (i.e., does not thrown an exception).
2) Comparator:
For example, if one adds two keys a and b such that
(a.equals((Object)b) && c.compare((Object)a, (Object)b) != 0)
to a sorted set with comparator c, the second add operation
will return false (and the size of the sorted set will not
increase) because a and b are equivalent from the sorted
set's perspective.
Typo. Should be:
(!a.equals((Object)b) && c.compare((Object)a, (Object)b) == 0)
3) Map: It would be convenient for Map.entrySet to @see Map.Entry.