mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -30,7 +30,7 @@ public enum GlobalPruneTimer {
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
private GlobalPruneTimer() {
|
||||
GlobalPruneTimer() {
|
||||
create();
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user