< prev index next >

src/java.base/windows/classes/java/io/WinNTFileSystem.java

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

*** 23,34 **** * questions. */ package java.io; - import java.security.AccessController; import java.util.Locale; import sun.security.action.GetPropertyAction; /** * Unicode-aware FileSystem for Windows NT/2000. * --- 23,34 ---- * questions. */ package java.io; import java.util.Locale; + import java.util.Properties; import sun.security.action.GetPropertyAction; /** * Unicode-aware FileSystem for Windows NT/2000. *
*** 40,53 **** private final char slash; private final char altSlash; private final char semicolon; public WinNTFileSystem() { ! slash = AccessController.doPrivileged( ! new GetPropertyAction("file.separator")).charAt(0); ! semicolon = AccessController.doPrivileged( ! new GetPropertyAction("path.separator")).charAt(0); altSlash = (this.slash == '\\') ? '/' : '\\'; } private boolean isSlash(char c) { return (c == '\\') || (c == '/'); --- 40,52 ---- private final char slash; private final char altSlash; private final char semicolon; public WinNTFileSystem() { ! Properties props = GetPropertyAction.getProperties(); ! slash = props.getProperty("file.separator").charAt(0); ! semicolon = props.getProperty("path.separator").charAt(0); altSlash = (this.slash == '\\') ? '/' : '\\'; } private boolean isSlash(char c) { return (c == '\\') || (c == '/');
< prev index next >