AuthScope bestMatch = null; for (final AuthScope current: map.keySet()) { final int factor = authscope.match(current); if (factor > bestMatchFactor) { bestMatchFactor = factor;
try { final AuthScope systemScope = new AuthScope(proxyHost, Integer.parseInt(proxyPort)); if (authscope.match(systemScope) >= 0) { final String proxyUser = System.getProperty(protocol + ".proxyUser"); if (proxyUser != null) {