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()
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()
- links to
-
Review openjdk/jdk/1467