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

Add Path.resolve with varargs string

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      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

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: