--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Fri Sep 02 14:46:27 2016 +0530
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java Thu Sep 01 10:35:38 2016 +0530
@@ -1074,7 +1074,7 @@
* 1) if (instProxy != null)
* connect to instProxy; raise exception if failed
* 2) else use system default ProxySelector
- * 3) is 2) fails, make direct connection
+ * 3) else make a direct connection if ProxySelector is not present
*/
if (instProxy == null) { // no instance Proxy is set
@@ -1117,10 +1117,7 @@
if (p != Proxy.NO_PROXY) {
sel.connectFailed(uri, p.address(), ioex);
if (!it.hasNext()) {
- // fallback to direct connection
- http = getNewHttpClient(url, null, connectTimeout, false);
- http.setReadTimeout(readTimeout);
- break;
+ throw ioex;
}
} else {
throw ioex;