diff --git a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java index ba0e8d0cb..23898c099 100644 --- a/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java +++ b/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java @@ -34,7 +34,6 @@ import java.util.Queue; import java.util.LinkedList; import java.util.Map; import java.util.Set; -import java.util.Stack; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.TimeUnit; @@ -83,7 +82,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc protected final Set leasedConnections; /** The list of free connections */ - protected final Stack freeConnections; + protected final Queue freeConnections; /** The list of WaitingThreads waiting for a connection */ protected final Queue waitingThreads; @@ -163,8 +162,8 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc * * @return a queue */ - protected Stack createFreeConnQueue() { - return new Stack(); + protected Queue createFreeConnQueue() { + return new LinkedList(); } /** @@ -463,7 +462,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc } rospl.freeEntry(entry); entry.updateExpiry(validDuration, timeUnit); - freeConnections.push(entry); + freeConnections.add(entry); } else { rospl.dropEntry(); numConnections--; @@ -612,7 +611,7 @@ public class ConnPoolByRoute extends AbstractConnPool { //TODO: remove dependenc poolLock.lock(); try { - BasicPoolEntry entry = freeConnections.pop(); + BasicPoolEntry entry = freeConnections.remove(); if (entry != null) { deleteEntry(entry);