Enable PMD rule UnnecessaryBoxing and fix violations
This commit is contained in:
parent
dd896347a2
commit
c73a8cebb8
6 changed files with 30 additions and 34 deletions
|
|
@ -15,7 +15,7 @@ public class IpAccessMonitor {
|
|||
synchronized (sync) {
|
||||
Long lastTime = ipAccess.get(ip);
|
||||
ipAccess.put(ip, t);
|
||||
return lastTime == null || t - lastTime.longValue() > MAX_IDLE;
|
||||
return lastTime == null || t - lastTime > MAX_IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ public class IpAccessMonitor {
|
|||
private static void cleanup(long t) {
|
||||
Map<String, Long> newMap = new HashMap<>(ipAccess.size());
|
||||
for (Map.Entry<String, Long> e : ipAccess.entrySet()) {
|
||||
if (t - e.getValue().longValue() <= MAX_IDLE) {
|
||||
if (t - e.getValue() <= MAX_IDLE) {
|
||||
newMap.put(e.getKey(), e.getValue());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue