diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/Limiter.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/Limiter.java index 5c501a6d38d..a05c2ec1b90 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/Limiter.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/Limiter.java @@ -40,7 +40,7 @@ public class Limiter { private static final Cache CACHE; static { - CACHE = CacheBuilder.builder() + CACHE = CacheBuilder.builder() .expireNanos(1, TimeUnit.MINUTES) .initializeCapacity(CAPACITY_SIZE) .sync(true) diff --git a/common/src/main/java/com/alibaba/nacos/common/cache/builder/CacheBuilder.java b/common/src/main/java/com/alibaba/nacos/common/cache/builder/CacheBuilder.java index 7920f68489c..082bc92b2db 100644 --- a/common/src/main/java/com/alibaba/nacos/common/cache/builder/CacheBuilder.java +++ b/common/src/main/java/com/alibaba/nacos/common/cache/builder/CacheBuilder.java @@ -39,7 +39,7 @@ public class CacheBuilder { private static final int DEFAULT_EXPIRE_NANOS = -1; private long expireNanos = DEFAULT_EXPIRE_NANOS; - + private int maximumSize = DEFAULT_MAXIMUMSIZE; private int initializeCapacity = DEFAULT_INITIALIZE_CAPACITY; @@ -48,14 +48,14 @@ public class CacheBuilder { private boolean lru = false; - public static CacheBuilder builder() { - return new CacheBuilder(); + public static CacheBuilder builder() { + return new CacheBuilder<>(); } /** * Set expiration time. */ - public CacheBuilder expireNanos(long duration, TimeUnit unit) { + public CacheBuilder expireNanos(long duration, TimeUnit unit) { checkExpireNanos(duration, unit); this.expireNanos = unit.toNanos(duration); return this; diff --git a/core/src/main/java/com/alibaba/nacos/core/utils/StringPool.java b/core/src/main/java/com/alibaba/nacos/core/utils/StringPool.java index 7c3020a0020..4d111c36e51 100644 --- a/core/src/main/java/com/alibaba/nacos/core/utils/StringPool.java +++ b/core/src/main/java/com/alibaba/nacos/core/utils/StringPool.java @@ -33,7 +33,7 @@ public class StringPool { private static final Cache GROUP_KEY_CACHE; static { - GROUP_KEY_CACHE = CacheBuilder.builder().maximumSize(5000000) + GROUP_KEY_CACHE = CacheBuilder.builder().maximumSize(5000000) .expireNanos(180, TimeUnit.SECONDS) .lru(true) .build();