< prev index next >
src/java.base/unix/classes/java/net/DefaultDatagramSocketImplFactory.java
Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs
@@ -22,11 +22,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package java.net;
-import java.security.AccessController;
+import sun.security.action.GetPropertyAction;
/**
* This class defines a factory for creating DatagramSocketImpls. It defaults
* to creating plain DatagramSocketImpls, but may create other DatagramSocketImpls
* by setting the impl.prefix system property.
@@ -38,12 +38,11 @@
static Class<?> prefixImplClass = null;
static {
String prefix = null;
try {
- prefix = AccessController.doPrivileged(
- new sun.security.action.GetPropertyAction("impl.prefix", null));
+ prefix = GetPropertyAction.getProperty("impl.prefix", null);
if (prefix != null)
prefixImplClass = Class.forName("java.net."+prefix+"DatagramSocketImpl");
} catch (Exception e) {
System.err.println("Can't find class: java.net." +
prefix +
< prev index next >