RFR 8194746: (fs) Add equivalents of Paths.get to Path interface

Chris Hegarty chris.hegarty at oracle.com
Thu Mar 8 09:05:18 UTC 2018


Brian,

> On 7 Mar 2018, at 21:57, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
> 
> https://bugs.openjdk.java.net/browse/JDK-8194746
> http://cr.openjdk.java.net/~bpb/8194746/webrev.00/

This looks good. Just a few minor comments.

> The main changes in are in Path and Paths in java.nio.file.
> 
> This patch copies the Paths.get() methods to static methods in Path.get() and modifies the former to call the latter respective methods. The Path specification is slightly cleaned up not to refer to Paths nor itself, e.g., “(see Path).” @implSpec annotations are added to Paths to indicate that the methods simply call their counterparts in Path.

I wonder if an @implSpec is too strong here. I guess I expected to see:
    * <p> Equivalent to: {@code Path.get(String, String...)}

Example snippets in the javadoc could use {@code …}, for example

    * <pre>{@code 
    *     Path dir = ...
    *     Path path = dir.resolve("file");
    * }</pre>

-Chris.


More information about the nio-dev mailing list