mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
fix code
This commit is contained in:
parent
e344c4ef54
commit
b8bacbcb2c
@ -125,5 +125,4 @@ public class CacheUtil {
|
||||
public static <K, V> NoCache<K, V> newNoCache(){
|
||||
return new NoCache<>();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,15 +1,15 @@
|
||||
package cn.hutool.cache.impl;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.core.collection.CopiedIter;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
|
||||
|
||||
import cn.hutool.cache.Cache;
|
||||
import cn.hutool.core.collection.CopiedIter;
|
||||
import cn.hutool.core.lang.func.Func0;
|
||||
|
||||
/**
|
||||
* 超时和限制大小的缓存的默认实现<br>
|
||||
* 继承此抽象缓存需要:<br>
|
||||
@ -189,6 +189,7 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
|
||||
|
||||
// ---------------------------------------------------------------- get end
|
||||
|
||||
@SuppressWarnings("NullableProblems")
|
||||
@Override
|
||||
public Iterator<V> iterator() {
|
||||
CacheObjIterator<K, V> copiedIterator = (CacheObjIterator<K, V>) this.cacheObjIterator();
|
||||
|
@ -40,7 +40,7 @@ public class LFUCache<K, V> extends AbstractCache<K, V> {
|
||||
|
||||
this.capacity = capacity;
|
||||
this.timeout = timeout;
|
||||
cacheMap = new HashMap<K, CacheObj<K, V>>(capacity + 1, 1.0f);
|
||||
cacheMap = new HashMap<>(capacity + 1, 1.0f);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- prune
|
||||
|
Loading…
Reference in New Issue
Block a user