Open
Description
I suggest to add a static method like the following to UUIDUtil (or any other appropriate class):
public static UUID generateThreadLocalRandomUUID() {
ThreadLocalRandom rnd = ThreadLocalRandom.current();
return UUIDUtil.constructUUID(UUIDType.RANDOM_BASED, rnd.nextLong(), rnd.nextLong());
}
Using a generator created by Generators.randomBasedGenerator(ThreadLocalRandom.current()) is probably not a good idea when working in an environment with thread pools (like Java/Jakarta EE), so i came to this solution.
Best regards, Robert
Metadata
Metadata
Assignees
Labels
No labels