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

UUID.getVersion() is only meaningful for Leach-Salz variant

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 7
    • core-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE PROBLEM :
      RFC 4122, section 4.1.3 says: " The following table lists the currently-defined versions for this UUID variant."

      Hence, it should be stated that the value returned by the getVersion() method is only meaningful for Leach-Salz variant UUID.

      Additionally, this method could throw an UnsupportedOperationException
      if the UUID is not a variant 2 UUID (although this modification is outside the scope of the documentation itself).



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Add:

      The version value is only meaningful in a Leach-Salz variant UUID , which has variant 2.
      ACTUAL -
      The variant number associated with this UUID. The variant number describes the layout of the UUID. The variant number has the following meaning:

      0 Reserved for NCS backward compatibility
      2 The Leach-Salz variant (used by this class)
      6 Reserved, Microsoft Corporation backward compatibility
      7 Reserved for future definition

      Returns:
      The variant number of this UUID


      URL OF FAULTY DOCUMENTATION :
      http://download.java.net/jdk7/docs/api/java/util/UUID.html#version()

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: