StringBuffer buf = new StringBuffer(secure ? "https: buf.append(Thread.currentThread().hashCode()); buf.append('@'); buf.append(host); buf.append(':'); buf.append(port); String key = buf.toString();
Object key = HTTPConnection.getPoolKey(host, port, secure);
  HTTPConnection getConnection(String host, int port, boolean secure)    throws IOException  {    HTTPConnection connection;    if (keepAlive)      {        StringBuffer buf = new StringBuffer(secure ? "https://" : "http://");        buf.append(Thread.currentThread().hashCode());        buf.append('@');        buf.append(host);        buf.append(':');        buf.append(port);        String key = buf.toString();        synchronized (connectionPool)          {            connection = (HTTPConnection) connectionPool.get(key);            if (connection == null)              {                connection = new HTTPConnection(host, port, secure);                // Good housekeeping                if (connectionPool.size() == maxConnections)                  {                    // maxConnections must always be >= 1                    Object lru = connectionPool.keySet().iterator().next();                    connectionPool.remove(lru);                  }                connectionPool.put(key, connection);              }          }      }    else      {        connection = new HTTPConnection(host, port, secure);      }    return connection;  }