diff --git a/hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java b/hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java
index 90df20303..4d32b7ed6 100644
--- a/hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java
+++ b/hutool-cache/src/main/java/cn/hutool/cache/impl/WeakCache.java
@@ -1,6 +1,6 @@
package cn.hutool.cache.impl;
-import java.util.WeakHashMap;
+import cn.hutool.core.map.WeakConcurrentMap;
/**
* 弱引用缓存
@@ -22,6 +22,6 @@ public class WeakCache extends TimedCache{
* @param timeout 超时时常,单位毫秒,-1或0表示无限制
*/
public WeakCache(long timeout) {
- super(timeout, new WeakHashMap<>());
+ super(timeout, new WeakConcurrentMap<>());
}
}
diff --git a/pom.xml b/pom.xml
index e9793eb85..4d394ac24 100644
--- a/pom.xml
+++ b/pom.xml
@@ -97,6 +97,7 @@
${compile.version}
${compile.version}
+ -Xlint:unchecked