RFR: 8262742: (fs) Add Path::resolve with varargs string

Jaikiran Pai jpai at openjdk.org
Sat Jul 8 06:03:11 UTC 2023


On Fri, 7 Jul 2023 18:50:14 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> Add to `java.nio.file.Path` methods which allow resolution of multiple descendants.

src/java.base/share/classes/java/nio/file/Path.java line 524:

> 522:      * <p> The result of this method is the same as would be obtained
> 523:      * by resolving the first parameter path against this path, then
> 524:      * resovling the second parameter path against the derived path,

Typo - should have been "resolving" instead of "resovling"

src/java.base/share/classes/java/nio/file/Path.java line 545:

> 543:      *
> 544:      * @throws  InvalidPathException
> 545:      *          if the path string cannot be converted to a Path.

Is this `@throws InvalidPathException` applicable for this method, since this doesn't take any string arguments?

src/java.base/share/classes/java/nio/file/Path.java line 553:

> 551:     default Path resolve(Path first, Path... more) {
> 552:         Path result = resolve(first);
> 553:         for (Path p : more) {

Hello Brian, do you think there should be a `@throws NullPointerException` in the javadoc, if any of these `Path` values is `null`?

src/java.base/share/classes/java/nio/file/Path.java line 567:

> 565:      * <p> The result of this method is the same as would be obtained
> 566:      * by resolving the first parameter path string against this path, then
> 567:      * resovling the second parameter path string against the derived path,

Typo - should have been "resolving"

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/14805#discussion_r1257061885
PR Review Comment: https://git.openjdk.org/jdk/pull/14805#discussion_r1257063435
PR Review Comment: https://git.openjdk.org/jdk/pull/14805#discussion_r1257060227
PR Review Comment: https://git.openjdk.org/jdk/pull/14805#discussion_r1257064549


More information about the nio-dev mailing list