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

(fs) Add Path::resolve with varargs string

    XMLWordPrintable

Details

    • b08
    • generic
    • generic

    Description

      A DESCRIPTION OF THE PROBLEM :
      Usage of java.nio.file.Path is rather cumbersome when resolving multiple constant children against an existing path, e.g.:
        applicationPath.resolve("path").resolve("to").resolve("resource")

      This often leads to developers falling back to hardcoding file path separators just because it is better readable (but also more error-prone).

      java.nio.file.Path should have a `resolve` overload with varargs String, either:
        - Path.resolve(String... others)
        - Path.resolve(String other, String... others)

      (This was originally mentioned in JDK-6878345 as well, but was apparently not implemented)


      Attachments

        Issue Links

          Activity

            People

              bpb Brian Burkhalter
              webbuggrp Webbug Group
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: