mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
Merge remote-tracking branch 'upstream/v5-dev' into v5-dev
This commit is contained in:
commit
a142a6e4dc
@ -10,6 +10,7 @@
|
||||
* 【core 】 multipart中int改为long,解决大文件上传越界问题(issue#I27WZ3@Gitee)
|
||||
|
||||
### Bug修复
|
||||
* 【cache 】 修复Cache中get重复misCount计数问题(issue#1281@Github)
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
@ -15,7 +15,7 @@ import java.util.concurrent.locks.StampedLock;
|
||||
* 继承此抽象缓存需要:<br>
|
||||
* <ul>
|
||||
* <li>创建一个新的Map</li>
|
||||
* <li>实现 <code>prune</code> 策略</li>
|
||||
* <li>实现 {@code prune} 策略</li>
|
||||
* </ul>
|
||||
*
|
||||
* @param <K> 键类型
|
||||
@ -30,11 +30,11 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
|
||||
private final StampedLock lock = new StampedLock();
|
||||
|
||||
/**
|
||||
* 返回缓存容量,<code>0</code>表示无大小限制
|
||||
* 返回缓存容量,{@code 0}表示无大小限制
|
||||
*/
|
||||
protected int capacity;
|
||||
/**
|
||||
* 缓存失效时长, <code>0</code> 表示无限制,单位毫秒
|
||||
* 缓存失效时长, {@code 0} 表示无限制,单位毫秒
|
||||
*/
|
||||
protected long timeout;
|
||||
|
||||
@ -168,10 +168,8 @@ public abstract class AbstractCache<K, V> implements Cache<K, V> {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (co.isExpired()) {
|
||||
missCount.getAndIncrement();
|
||||
} else {
|
||||
// 命中
|
||||
// 命中
|
||||
if (false == co.isExpired()) {
|
||||
hitCount.getAndIncrement();
|
||||
return co.get(isUpdateLastAccess);
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import java.sql.SQLException;
|
||||
* @author Luxiaolei
|
||||
*
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface RsHandler<T> extends Serializable{
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user