8170432: Class java.util.UUID & @Override
Reviewed-by: dfuchs, lancea
This commit is contained in:
parent
5be4de8583
commit
b4cba15a0e
@ -456,6 +456,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||
*
|
||||
* @return A string representation of this {@code UUID}
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return jla.fastUUID(leastSigBits, mostSigBits);
|
||||
}
|
||||
@ -465,6 +466,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||
*
|
||||
* @return A hash code value for this {@code UUID}
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
long hilo = mostSigBits ^ leastSigBits;
|
||||
return ((int)(hilo >> 32)) ^ (int) hilo;
|
||||
@ -482,6 +484,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||
* @return {@code true} if the objects are the same; {@code false}
|
||||
* otherwise
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if ((null == obj) || (obj.getClass() != UUID.class))
|
||||
return false;
|
||||
@ -506,6 +509,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||
* greater than {@code val}
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(UUID val) {
|
||||
// The ordering is intentionally set up so that the UUIDs
|
||||
// can simply be numerically compared as two numbers
|
||||
|
Loading…
x
Reference in New Issue
Block a user