Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6427291

(coll) Comparator should mention null parameter

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 6
    • core-libs
    • b15
    • generic
    • generic
    • Not verified

        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.

              martin Martin Buchholz
              dmiltsov Dmitry Miltsov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: