Looly 5 年 前
コミット
4827c61641

+ 2 - 2
hutool-cache/src/main/java/cn/hutool/cache/impl/AbstractCache.java

@@ -45,11 +45,11 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
 	/**
 	/**
 	 * 命中数
 	 * 命中数
 	 */
 	 */
-	protected AtomicLong hitCount;
+	protected AtomicLong hitCount = new AtomicLong();
 	/**
 	/**
 	 * 丢失数
 	 * 丢失数
 	 */
 	 */
-	protected AtomicLong missCount;
+	protected AtomicLong missCount = new AtomicLong();
 
 
 	// ---------------------------------------------------------------- put start
 	// ---------------------------------------------------------------- put start
 	@Override
 	@Override

+ 1 - 1
hutool-cache/src/main/java/cn/hutool/cache/impl/CacheObj.java

@@ -19,7 +19,7 @@ public class CacheObj<K, V> implements Serializable{
 	/** 上次访问时间 */
 	/** 上次访问时间 */
 	private volatile long lastAccess;
 	private volatile long lastAccess;
 	/** 访问次数 */
 	/** 访问次数 */
-	protected AtomicLong accessCount;
+	protected AtomicLong accessCount = new AtomicLong();
 	/** 对象存活时长,0表示永久存活*/
 	/** 对象存活时长,0表示永久存活*/
 	private final long ttl;
 	private final long ttl;