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

(spec) UUID.compareTo() spec unclear on relationship between UUID ordering and "greater"

XMLWordPrintable

    • b15
    • sparc
    • solaris_2.6
    • Not verified

      Name: apR10229 Date: 09/05/2003


      Filed By : SPB JCK team (###@###.###)
      JDK : java full version "1.5.0-beta-b16"
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : N/A


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...
      public int compareTo(UUID val)

          Compares this UUID with the specified UUID.

          The first of two UUIDs follows the second if the most significant field in which the UUIDs differ is greater for the first UUID.

          An IllegalArgumentException is thrown if the argument is not of the same variant type as this UUID.

      Parameters:
      val - UUID to which this UUID is to be compared. Returns:
      -1, 0 or 1 as this UUID is less than, equal to, or greater than val. Throws:
      IllegalArgumentException - if val is a different variant of UUID.
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      For java.util.UUID.compareTo() it is not clear what UUID is greater:
      following or preceding. Please explain more careful.

      JCK test source location:
      ==========================
      /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

      ======================================================================

            iris Iris Clark
            pavsunw Pav Pav (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: