Skip to content
Permalink
Browse files
8170432: Class java.util.UUID & @OverRide
Reviewed-by: dfuchs, lancea
  • Loading branch information
Fleshgrinder authored and Lance Andersen committed Nov 27, 2020
1 parent 5be4de8 commit b4cba15a0e06c9126a85ce300c0653b58b9af9b2
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/java.base/share/classes/java/util/UUID.java
@@ -456,6 +456,7 @@ public long node() {
*
* @return A string representation of this {@code UUID}
*/
@Override
public String toString() {
return jla.fastUUID(leastSigBits, mostSigBits);
}
@@ -465,6 +466,7 @@ public String toString() {
*
* @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 int hashCode() {
* @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 boolean equals(Object obj) {
* 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

1 comment on commit b4cba15

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on b4cba15 Nov 27, 2020

Please sign in to comment.