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;
* 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 {
@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;
}