mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change name
This commit is contained in:
@@ -44,9 +44,8 @@ public class CacheObj<K, V> implements Serializable{
|
||||
*/
|
||||
boolean isExpired() {
|
||||
if(this.ttl > 0) {
|
||||
final long expiredTime = this.lastAccess + this.ttl;
|
||||
// expiredTime > 0 杜绝Long类型溢出变负数问题,当当前时间超过过期时间,表示过期
|
||||
return expiredTime > 0 && expiredTime < System.currentTimeMillis();
|
||||
// 此处不考虑时间回拨
|
||||
return (System.currentTimeMillis() - this.lastAccess) > this.ttl;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user