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

javadoc of java.util.Arrays.compare(T[] a, T[] b) misses the word "less"

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      No behavioral change. Minor fix of method-level documentation. The behavior being clarified is confirmed in test/jdk/java/util/Arrays/ArraysEqCmpTest.testNullElementsInObjectArray().
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      The word 'less' is missing in the method-level javadoc of java.util.Arrays.compare(compare(T[] a, T[] b).

      Problem

      The current version of this javadoc is erroneous:

      * A {@code null} array element is considered lexicographically than a
      * non-{@code null} array element. Two {@code null} array elements are
      * considered equal. 

      Solution

      Change to:

      * A {@code null} array element is considered lexicographically less than a
      * non-{@code null} array element. Two {@code null} array elements are
      * considered equal. 

      Specification

      --- old/src/java.base/share/classes/java/util/Arrays.java   2019-11-26 10:25:29.000000000 +0000
      +++ new/src/java.base/share/classes/java/util/Arrays.java   2019-11-26 10:25:29.000000000 +0000
      @@ -7117,10 +7117,10 @@
      -     * A {@code null} array element is considered lexicographically than a
      -     * non-{@code null} array element.  Two {@code null} array elements are
      +     * A {@code null} array element is considered lexicographically less than a
      +     * non-{@code null} array element. Two {@code null} array elements are
            * considered equal.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jboes Julia Boes
                Reporter:
                jboes Julia Boes
                Reviewed By:
                Daniel Fuchs, Lance Andersen
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: