< prev index next >

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

Print this page

        

*** 41,51 **** class WinNTFileSystem extends FileSystem { private final char slash; private final char altSlash; private final char semicolon; ! private final String userDir; public WinNTFileSystem() { Properties props = GetPropertyAction.privilegedGetProperties(); slash = props.getProperty("file.separator").charAt(0); semicolon = props.getProperty("path.separator").charAt(0); --- 41,52 ---- class WinNTFileSystem extends FileSystem { private final char slash; private final char altSlash; private final char semicolon; ! private String userDir; ! private volatile boolean isUserDirNormal; public WinNTFileSystem() { Properties props = GetPropertyAction.privilegedGetProperties(); slash = props.getProperty("file.separator").charAt(0); semicolon = props.getProperty("path.separator").charAt(0);
*** 351,361 **** we must look this up every time */ SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPropertyAccess("user.dir"); } ! return normalize(userDir); } private String getDrive(String path) { int pl = prefixLength(path); return (pl == 3) ? path.substring(0, 2) : null; --- 352,372 ---- we must look this up every time */ SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPropertyAccess("user.dir"); } ! boolean normalize = !isUserDirNormal; ! if (normalize) { ! synchronized(userDir) { ! normalize = !isUserDirNormal; ! if (normalize) { ! userDir = normalize(userDir); ! isUserDirNormal = true; ! } ! } ! } ! return userDir; } private String getDrive(String path) { int pl = prefixLength(path); return (pl == 3) ? path.substring(0, 2) : null;
< prev index next >