This commit is contained in:
Looly
2019-09-28 03:13:27 +08:00
parent daf85caf9e
commit 596a4f1e57
110 changed files with 535 additions and 617 deletions

View File

@@ -30,7 +30,7 @@ public enum GlobalPruneTimer {
/**
* 构造
*/
private GlobalPruneTimer() {
GlobalPruneTimer() {
create();
}

View File

@@ -44,10 +44,8 @@ public class CacheObj<K, V> implements Serializable{
boolean isExpired() {
if(this.ttl > 0) {
final long expiredTime = this.lastAccess + this.ttl;
if(expiredTime > 0 && expiredTime < System.currentTimeMillis()) {
// expiredTime > 0 杜绝Long类型溢出变负数问题当当前时间超过过期时间表示过期
return true;
}
// expiredTime > 0 杜绝Long类型溢出变负数问题当当前时间超过过期时间表示过期
return expiredTime > 0 && expiredTime < System.currentTimeMillis();
}
return false;
}