< prev index next >

src/java.base/share/classes/sun/net/www/http/HttpClient.java

Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs

*** 26,44 **** --- 26,46 ---- package sun.net.www.http; import java.io.*; import java.net.*; import java.util.Locale; + import java.util.Properties; import sun.net.NetworkClient; import sun.net.ProgressSource; import sun.net.www.MessageHeader; import sun.net.www.HeaderParser; import sun.net.www.MeteredStream; import sun.net.www.ParseUtil; import sun.net.www.protocol.http.HttpURLConnection; import sun.util.logging.PlatformLogger; import static sun.net.www.protocol.http.HttpURLConnection.TunnelState.*; + import sun.security.action.GetPropertyAction; /** * @author Herb Jellinek * @author Dave Brown */
*** 141,164 **** int getKeepAliveTimeout() { return keepAliveTimeout; } static { ! String keepAlive = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("http.keepAlive")); ! ! String retryPost = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("sun.net.http.retryPost")); if (keepAlive != null) { ! keepAliveProp = Boolean.valueOf(keepAlive).booleanValue(); } else { keepAliveProp = true; } if (retryPost != null) { ! retryPostProp = Boolean.valueOf(retryPost).booleanValue(); } else retryPostProp = true; } --- 143,164 ---- int getKeepAliveTimeout() { return keepAliveTimeout; } static { ! Properties props = GetPropertyAction.getProperties(); ! String keepAlive = props.getProperty("http.keepAlive"); ! String retryPost = props.getProperty("sun.net.http.retryPost"); if (keepAlive != null) { ! keepAliveProp = Boolean.parseBoolean(keepAlive); } else { keepAliveProp = true; } if (retryPost != null) { ! retryPostProp = Boolean.parseBoolean(retryPost); } else retryPostProp = true; }
< prev index next >