#629 - DefaultServerCache using java 1.7 compare method, drop trim logging from DEBUG to TRACE

This commit is contained in:
Robin Bygrave
2016-03-31 14:05:59 +13:00
parent 33f3920a60
commit fb2b8b4cf6
@@ -333,8 +333,8 @@ public class DefaultServerCache implements ServerCache {
evictByTTL.add(trimmedByTTL);
evictByLRU.add(trimmedByLRU);
if (logger.isDebugEnabled()) {
logger.debug("Executed trim of cache {} in [{}]millis idle[{}] timeToLive[{}] accessTime[{}]"
if (logger.isTraceEnabled()) {
logger.trace("Executed trim of cache {} in [{}]millis idle[{}] timeToLive[{}] accessTime[{}]"
, name, exeMicros, trimmedByIdle, trimmedByTTL, trimmedByLRU);
}
}
@@ -358,7 +358,9 @@ public class DefaultServerCache implements ServerCache {
private static final long serialVersionUID = 1L;
public int compare(CacheEntry entry1, CacheEntry entry2) {
return Long.compare(entry1.getLastAccessTime(), entry2.getLastAccessTime());
long x = entry1.getLastAccessTime();
long y = entry2.getLastAccessTime();
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
}