Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8271737

Only normalize the cached user.dir property once

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 18
    • None
    • core-libs
    • None
    • 11
    • b19

      JDK-8198997 introduced normalization for the cached "user.dir" property in order to avoid "inefficient, repeated normalization".

      However WinNTFileSystem.getUserPath(), the only
      place where the cached and normalized "userDir" value is used, still calls normalize() on each invocation:

      class WinNTFileSystem extends FileSystem {
      ...
          private final String userDir;
      ...
          public WinNTFileSystem() {
      ...
              userDir = normalize(props.getProperty("user.dir"));
        }
      ...
          private String getUserPath() {
      ...
              return normalize(userDir);
          }

      This is not necessary and can be improved.

            eastigeevich Evgeny Astigeevich
            simonis Volker Simonis
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: