< prev index next >
src/java.base/share/classes/java/net/URLConnection.java
Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs
@@ -41,10 +41,11 @@
import java.util.List;
import java.security.Permission;
import java.security.AccessController;
import sun.security.util.SecurityConstants;
import sun.net.www.MessageHeader;
+import sun.security.action.GetPropertyAction;
/**
* The abstract class {@code URLConnection} is the superclass
* of all classes that represent a communications link between the
* application and a URL. Instances of this class can be used both to
@@ -1393,12 +1394,12 @@
* to use as a set of package prefixes to search. Whether or not
* that property has been defined, the {@value #contentClassPrefix}
* is always the last one on the returned package list.
*/
private String getContentHandlerPkgPrefixes() {
- String packagePrefixList = AccessController.doPrivileged(
- new sun.security.action.GetPropertyAction(contentPathProp, ""));
+ String packagePrefixList =
+ GetPropertyAction.getProperty(contentPathProp, "");
if (packagePrefixList != "") {
packagePrefixList += "|";
}
< prev index next >