Object key = HTTPConnection.getPoolKey(host, port, secure); synchronized (connectionPool) { connection = (HTTPConnection) connectionPool.remove(key); if (connection == null) { connection = new HTTPConnection(host, port, secure); connection.setPool(connectionPool); } }
connection = HTTPConnection.Pool.instance.get(host, port, secure);
  HTTPConnection getConnection(String host, int port, boolean secure)    throws IOException  {    HTTPConnection connection;    if (keepAlive)      {        Object key = HTTPConnection.getPoolKey(host, port, secure);        synchronized (connectionPool)          {            connection = (HTTPConnection) connectionPool.remove(key);            if (connection == null)              {                connection = new HTTPConnection(host, port, secure);                connection.setPool(connectionPool);              }          }      }    else      {        connection = new HTTPConnection(host, port, secure);      }    return connection;  }