RFR: 8334015: Add Support for UUID Version 7 (UUIDv7) defined in RFC 9562 [v18]

Jaikiran Pai jpai at openjdk.org
Thu Oct 9 13:28:35 UTC 2025


On Thu, 9 Oct 2025 13:04:51 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Kieran Farrell has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove old test case reference
>
> 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.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25303#discussion_r2416793794


More information about the core-libs-dev mailing list