List<Proxy> (@NotNull URI uri) { // It is important to avoid resetting Pac based ProxySelector unless option was changed // New instance will download configuration file and interpret it before making the connection String pacUrlForUse = myHttpConfigurable.USE_PAC_URL && !StringUtil.isEmpty(myHttpConfigurable.PAC_URL) ? myHttpConfigurable.PAC_URL : null; Pair<ProxySelector, String> pair = myPacProxySelector.get(); if (pair != null && !Objects.equals(pair.second, pacUrlForUse)) { pair = null; } if (pair == null) { ProxySelector newProxySelector = NetUtils.getProxySelector(pacUrlForUse); pair = Pair.create(newProxySelector, pacUrlForUse); myPacProxySelector.lazySet(pair); } ProxySelector pacProxySelector = pair.first; if (pacProxySelector == null) { LOG.debug("No proxies detected"); } else { try { List<Proxy> select = pacProxySelector.select(uri); LOG.debug("Autodetected proxies: ", select); return select; } catch (StackOverflowError ignore) { LOG.warn("Too large PAC script (JRE-247)"); } } return CommonProxy.NO_PROXY_LIST; }