Update src/java.base/share/classes/java/util/UUID.java

Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
This commit is contained in:
Shaojin Wen 2025-06-15 13:49:42 +08:00 committed by GitHub
parent 6f491cedc2
commit 9b9bfb1db8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -469,7 +469,7 @@ public final class UUID implements java.io.Serializable, Comparable<UUID> {
buf[23] = '-';
// Although the UUID byte ordering is defined to be big-endian, ByteArrayLittleEndian is used here to optimize
// for the most common architectures. hex8 reverses the order internally.
// for the most common architectures.
ByteArrayLittleEndian.setLong(buf, 0, Long.reverseBytes(HexDigits.hex8(mostSigBits >>> 32)));
long x0 = Long.reverseBytes(HexDigits.hex8(mostSigBits));
ByteArrayLittleEndian.setInt(buf, 9, (int) x0);