commit:同步1.3版本

This commit is contained in:
Jerry
2021-01-03 22:29:02 +08:00
parent ef316438da
commit 25023e29b5
706 changed files with 23404 additions and 14179 deletions

View File

@@ -13,7 +13,7 @@ import cn.hutool.core.util.IdUtil;
*/
public class BasicIdGenerator implements MyIdGenerator {
private Snowflake snowflake;
private final Snowflake snowflake;
/**
* 构造函数。

View File

@@ -25,7 +25,7 @@ public class SnowflakeIdGenerator implements MyIdGenerator {
private static final long SEQUENCE_BITS = 12L;
private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
private static final long SEQUENCE_MASK = ~(-1L << SEQUENCE_BITS);
private long workerId;
private final long workerId;
private long sequence = 0L;
private long lastTimestamp = -1L;
private static final Random RANDOM = RandomUtil.getRandom();