< prev index next >

src/java.base/windows/classes/sun/nio/ch/FileDispatcherImpl.java

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

*** 25,37 **** package sun.nio.ch; import java.io.FileDescriptor; import java.io.IOException; - import java.security.PrivilegedAction; import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.JavaIOFileDescriptorAccess; class FileDispatcherImpl extends FileDispatcher { private static final JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess(); --- 25,37 ---- package sun.nio.ch; import java.io.FileDescriptor; import java.io.IOException; import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.JavaIOFileDescriptorAccess; + import sun.security.action.GetPropertyAction; class FileDispatcherImpl extends FileDispatcher { private static final JavaIOFileDescriptorAccess fdAccess = SharedSecrets.getJavaIOFileDescriptorAccess();
*** 117,133 **** boolean transferToDirectlyNeedsPositionLock() { return true; } static boolean isFastFileTransferRequested() { ! String fileTransferProp = java.security.AccessController.doPrivileged( ! new PrivilegedAction<String>() { ! @Override ! public String run() { ! return System.getProperty("jdk.nio.enableFastFileTransfer"); ! } ! }); boolean enable; if ("".equals(fileTransferProp)) { enable = true; } else { enable = Boolean.parseBoolean(fileTransferProp); --- 117,128 ---- boolean transferToDirectlyNeedsPositionLock() { return true; } static boolean isFastFileTransferRequested() { ! String fileTransferProp = GetPropertyAction ! .getProperty("jdk.nio.enableFastFileTransfer"); boolean enable; if ("".equals(fileTransferProp)) { enable = true; } else { enable = Boolean.parseBoolean(fileTransferProp);
< prev index next >