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

Only normalize the cached user.dir property once

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 18
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Introduced In Version:
      11
    • Resolved In Build:
      b19

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: