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

(fs) Optimize UnixPath.encode implementation

    XMLWordPrintable

Details

    • b06

    Description

      UnixPath.encode duplicates the logic exposed via JavaLangAccess.getBytesNoRepl, just with rewrapping any exception thrown in a InvalidPathException. Merging this removes a commonly created ThreadLocal, and will likely hit one of the fast-paths in StringCoding.encode.

      The toCharArray done for the purpose dealing with paths that need normalization on Mac is also costly up front in a way that could be avoided.

      This was found when looking into startup profiles of the Spring PetClinic.

      Attachments

        Issue Links

          Activity

            People

              redestad Claes Redestad
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: