X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.api.uuid%2Fsrc%2Forg%2Fargeo%2Fapi%2Fuuid%2FConcurrentTimeUuidState.java;h=fd158fb8315db647b8d0b07e7790d1ec57aa2b3f;hb=98f2c711418690e62e35c931e35d1dc92fd07926;hp=8131df8eebbd0bfdb9dad16e9210b64b84a1ea88;hpb=ee0a9f240a5da3a1437dda5abe7a1c46c5a3a8e9;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.api.uuid/src/org/argeo/api/uuid/ConcurrentTimeUuidState.java b/org.argeo.api.uuid/src/org/argeo/api/uuid/ConcurrentTimeUuidState.java index 8131df8ee..fd158fb83 100644 --- a/org.argeo.api.uuid/src/org/argeo/api/uuid/ConcurrentTimeUuidState.java +++ b/org.argeo.api.uuid/src/org/argeo/api/uuid/ConcurrentTimeUuidState.java @@ -9,6 +9,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.WeakHashMap; +import java.util.concurrent.ForkJoinPool; import java.util.concurrent.atomic.AtomicLong; import org.argeo.api.uuid.UuidFactory.TimeUuidState; @@ -21,7 +22,7 @@ import org.argeo.api.uuid.UuidFactory.TimeUuidState; * sequences. If that limit is reached, the clock sequence which has not be used * for the most time is reallocated to the new thread. It is assumed that the * context where time uUIDs will be generated will often be using thread pools - * (e.g. {@link ForkJoinPool#commonPool(), http server, database access, etc.) + * (e.g. {@link ForkJoinPool#commonPool()}, http server, database access, etc.) * and that such reallocation won't have to happen too often. */ public class ConcurrentTimeUuidState implements UuidFactory.TimeUuidState { @@ -142,9 +143,7 @@ public class ConcurrentTimeUuidState implements UuidFactory.TimeUuidState { @Override public long getMostSignificantBits() { long timestamp = useTimestamp(); - long mostSig = UuidFactory.MOST_SIG_VERSION1 | ((timestamp & 0xFFFFFFFFL) << 32) // time_low - | (((timestamp >> 32) & 0xFFFFL) << 16) // time_mid - | ((timestamp >> 48) & 0x0FFFL);// time_hi_and_version + long mostSig = TimeUuid.toMostSignificantBits(timestamp); return mostSig; }