-
Bug
-
Resolution: Fixed
-
P4
-
6
-
b15
-
generic
-
generic
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2152547 | OpenJDK6 | Martin Buchholz | P3 | Resolved | Fixed | b01 |
Interfaces Comparable and Comparator have similar methods
compareTo(T o) and compare(T o1, T o2). The spec for method
compareTo says that compareTo(null) should throw NPE,
but is unclear how should behave method compare(...) while one
or both or arguments is null.
Even if the method compare(...) should not throw NPE, its behaviour
in this case should be mentioned in the spec, because it is
inconsistent with similar compareTo method.
compareTo(T o) and compare(T o1, T o2). The spec for method
compareTo says that compareTo(null) should throw NPE,
but is unclear how should behave method compare(...) while one
or both or arguments is null.
Even if the method compare(...) should not throw NPE, its behaviour
in this case should be mentioned in the spec, because it is
inconsistent with similar compareTo method.
- backported by
-
JDK-2152547 (coll) Comparator should mention null parameter
- Resolved
- relates to
-
JDK-5045147 (coll) Adding null key to empty TreeMap without Comparator should throw NPE
- Closed
-
JDK-6245436 (spec) Comparable.compareTo(null) should document behavior on null input
- Closed