Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 b4cba15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/java.base/share/classes/java/util/UUID.java
Expand Up @@ -456,6 +456,7 @@ public long node() {
*
* @return A string representation of this {@code UUID}
*/
@Override
public String toString() {
return jla.fastUUID(leastSigBits, mostSigBits);
}
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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
Expand Down

1 comment on commit b4cba15

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.