-Djdk.net.usePlainSocketImpl without value should use PlainSocketImpl niosocketimpl-branch
authoralanb
Mon, 11 Feb 2019 19:16:13 +0000
branchniosocketimpl-branch
changeset 57177 0b5ebb227a8d
parent 57176 726630bc6a4c
child 57178 738431fa8fb2
-Djdk.net.usePlainSocketImpl without value should use PlainSocketImpl
src/java.base/share/classes/java/net/SocketImpl.java
--- a/src/java.base/share/classes/java/net/SocketImpl.java	Mon Feb 11 15:17:31 2019 +0000
+++ b/src/java.base/share/classes/java/net/SocketImpl.java	Mon Feb 11 19:16:13 2019 +0000
@@ -35,7 +35,6 @@
 
 import sun.net.NetProperties;
 import sun.nio.ch.NioSocketImpl;
-import sun.security.action.GetPropertyAction;
 
 /**
  * The abstract class {@code SocketImpl} is a common superclass
@@ -52,9 +51,9 @@
     private static final boolean USE_PLAINSOCKETIMPL = usePlainSocketImpl();
 
     private static boolean usePlainSocketImpl() {
-        PrivilegedAction<Boolean> pa = () -> NetProperties.getBoolean("jdk.net.usePlainSocketImpl");
-        Boolean val = AccessController.doPrivileged(pa);
-        return val == null ? false : val;
+        PrivilegedAction<String> pa = () -> NetProperties.get("jdk.net.usePlainSocketImpl");
+        String s = AccessController.doPrivileged(pa);
+        return (s != null) && !s.equalsIgnoreCase("false");
     }
 
     /**