RFR: 8334015: Add Support for UUID Version 7 (UUIDv7) defined in RFC 9562 [v18]
Kieran Farrell
kfarrell at openjdk.org
Thu Oct 9 10:17:10 UTC 2025
On Wed, 8 Oct 2025 21:33:19 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> 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.
@RogerRiggs good with me, CSR has been updated now
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25303#issuecomment-3385157330
More information about the core-libs-dev
mailing list