RFR: 8334015: Add Support for UUID Version 7 (UUIDv7) defined in RFC 9562 [v18]
Alan Bateman
alanb at openjdk.org
Thu Oct 9 13:34:00 UTC 2025
On Thu, 9 Oct 2025 13:25:40 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> src/java.base/share/classes/java/util/UUID.java line 207:
>>
>>> 205: * @return a {@code UUID} constructed using the given {@code timestamp}
>>> 206: *
>>> 207: * @throws IllegalArgumentException if the timestamp is negative or greater than {@code 281474976710655L}
>>
>> What would you think about using (1L << 48) - 1 instead?
>
> I think the use of `281474976710655L` value in the javadoc was borrowed from my proposal to use this value. My personal preference was to use this explicit value because I then don't have to do the actual computation of what "(1L << 48) - 1" equals to when reading that javadoc.
>
> But if "(1L << 48) - 1" is preferable, then that's OK with me.
It's not important, it's just that the apiNote uses "48 bits" at least twice, it may not be immediately obvious when it then jumps to 281474976710655L in the IAE description.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25303#discussion_r2416812247
More information about the core-libs-dev
mailing list