Timed UUID comparison

Jesper Wilhelmsson jesper.wilhelmsson at oracle.com
Mon Jun 21 12:40:54 UTC 2021

Hi Wouter,

As a first step to fix an issue in the JDK, I recommend that you read this section in the OpenJDK Developers' Guide: https://openjdk.java.net/guide/#i-have-a-patch-what-do-i-do

Best regards,

> 21 juni 2021 kl. 13:55 skrev Wouter Wijsman <wwijsman at live.nl>:
> Dear JDK developers,
> A couple of weeks ago I found that the compareTo function in the UUID class in Java does not look at timestamps when comparing time based UUIDs. The result of this is that when using this function to sort time based UUIDS, the order seems somewhat random. This was quite surprising to me and caused a bug in one of my applications.
> I managed to find out where this comparison is done in the OpenJDK implementation and I made a pull request with a simple fix on Github, but since there is no official bug report for this behavior, it hasn't been reviewed yet. The pull request can be found here: https://github.com/openjdk/jdk/pull/3620
> Are there any opinions on this behavior and is this pull request wanted? Otherwise I'll just close it.
> Kind regards,
> Wouter Wijsman

More information about the jdk-dev mailing list