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

Roger Riggs rriggs at openjdk.org
Wed Oct 8 21:36:10 UTC 2025


On Thu, 2 Oct 2025 10:56:34 GMT, Kieran Farrell <kfarrell 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
>
> As Bokken highlighted, I think it might be worth adding a method (similar to the below) to extract the timestamp from v7 UUIDs?
> 
> 
> public long epochMilliTimestamp() {
>     if (version() != 7) {
>         throw new UnsupportedOperationException("Not a version 7 UUID");
>     }
>     return (mostSigBits >>> 16) & 0xFFFFFFFFFFFFL;
> }
> 
> 
> Regarding, the issues around comparison, as mentioned I think would it would be worth updating the current `compareTo` doc to identify that the implmentation uses signed long comparison and may not provide lexographical sorting in align with the rfc which can be problmetaic for time based UUIDs and also to add a seperate instance method but with lexographical sorting using unsigned comparrsion.

@kieran-farrell Please update the CSR with the current single API addition.

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

PR Comment: https://git.openjdk.org/jdk/pull/25303#issuecomment-3383316919


More information about the core-libs-dev mailing list