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

Paul Sandoz paul.sandoz at oracle.com
Thu Mar 8 00:37:02 UTC 2018



> On Mar 7, 2018, at 1:57 PM, 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/
> 

Path.java

 639      * {@link Paths#get(URI) Path.get}{@code (}<i>p</i>{@code .toUri()).equals(}<i>p</i>

The link refers to Paths not Path.

Nice cleanup. It was always a painful for those new to this area to find the Path factories.

Paul.

> 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.
> 
> All source files in java.base are modified to change Paths.get() to Path.get() and to remove the import for Paths. The copyright year is not yet updated in these files.
> 
> No tests are added or modified as Paths is final and the Path.get() methods end up being invoked indirectly in existing tests.
> 
> Perhaps some excision of the specification verbiage in Paths is called for to minimize duplication?
> 
> Once this starts to achieve consensus a CSR will be filed.
> 
> Thanks,
> 
> Brian



More information about the nio-dev mailing list