IDEA-205492 Proxy validation may take much time with resolving dependencies

GitOrigin-RevId: 49f169c24d9947e92a6cee786023e4a51f80bb88
This commit is contained in:
Leonid Shalupov
2021-04-11 19:02:14 +03:00
committed by intellij-monorepo-bot
parent cd1ce82582
commit f93f77463c

View File

@@ -41,7 +41,7 @@ final class JreProxySelector implements ProxySelector {
final String proxyType = chooseProxyType(uri.getScheme());
if (proxyType != null) {
final InetSocketAddress addr = (InetSocketAddress)proxy.address();
return new Proxy(proxyType, addr.getHostName(), addr.getPort(), JreProxyAuthentication.INSTANCE);
return new Proxy(proxyType, addr.getHostString(), addr.getPort(), JreProxyAuthentication.INSTANCE);
}
}
}
@@ -69,7 +69,8 @@ final class JreProxySelector implements ProxySelector {
* objects with empty host and port 0.
*/
final InetSocketAddress addr = (InetSocketAddress)address;
return addr.getPort() > 0 && addr.getHostName() != null && !addr.getHostName().isEmpty();
String hostString = addr.getHostString();
return addr.getPort() > 0 && hostString != null && !hostString.isEmpty();
}
return false;
}