Explicit boxing

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1170168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2011-09-13 13:14:57 +00:00
parent 6fa7185b74
commit 5e1f6e6eb6
1 changed files with 5 additions and 5 deletions

View File

@ -86,9 +86,9 @@ public class AIMDBackoffManager implements BackoffManager {
int curr = connPerRoute.getMaxForRoute(route); int curr = connPerRoute.getMaxForRoute(route);
Long lastUpdate = getLastUpdate(lastRouteBackoffs, route); Long lastUpdate = getLastUpdate(lastRouteBackoffs, route);
long now = clock.getCurrentTime(); long now = clock.getCurrentTime();
if (now - lastUpdate < coolDown) return; if (now - lastUpdate.longValue() < coolDown) return;
connPerRoute.setMaxForRoute(route, getBackedOffPoolSize(curr)); connPerRoute.setMaxForRoute(route, getBackedOffPoolSize(curr));
lastRouteBackoffs.put(route, now); lastRouteBackoffs.put(route, Long.valueOf(now));
} }
} }
@ -104,16 +104,16 @@ public class AIMDBackoffManager implements BackoffManager {
Long lastProbe = getLastUpdate(lastRouteProbes, route); Long lastProbe = getLastUpdate(lastRouteProbes, route);
Long lastBackoff = getLastUpdate(lastRouteBackoffs, route); Long lastBackoff = getLastUpdate(lastRouteBackoffs, route);
long now = clock.getCurrentTime(); long now = clock.getCurrentTime();
if (now - lastProbe < coolDown || now - lastBackoff < coolDown) if (now - lastProbe.longValue() < coolDown || now - lastBackoff.longValue() < coolDown)
return; return;
connPerRoute.setMaxForRoute(route, max); connPerRoute.setMaxForRoute(route, max);
lastRouteProbes.put(route, now); lastRouteProbes.put(route, Long.valueOf(now));
} }
} }
private Long getLastUpdate(Map<HttpRoute,Long> updates, HttpRoute route) { private Long getLastUpdate(Map<HttpRoute,Long> updates, HttpRoute route) {
Long lastUpdate = updates.get(route); Long lastUpdate = updates.get(route);
if (lastUpdate == null) lastUpdate = 0L; if (lastUpdate == null) lastUpdate = Long.valueOf(0L);
return lastUpdate; return lastUpdate;
} }