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

Roger Riggs Roger.Riggs at Oracle.com
Thu Mar 15 13:54:17 UTC 2018


Hi Brian,

Looks fine.

I'm not sure how to interpret "obsolete" especially in relation to the 
various contexts
where "deprecated" is used.  I think it means code that uses Paths.get 
should be modified
to use Path.of.  This sounds like a vanilla use of @deprecated with a 
convenient replacement.
Not for removal of course because there's no plan to remove it (for now).

Thanks, Roger


On 3/14/2018 4:09 PM, Brian Burkhalter wrote:
> An updated version with the change s/Path.get/Path.of/ and most of the 
> Paths.get() javadoc excised is at
>
> http://cr.openjdk.java.net/~bpb/8194746/webrev.02/ 
> <http://cr.openjdk.java.net/%7Ebpb/8194746/webrev.02/>
>
> For the sake of clarity, this omits the changes to other files in 
> java.base which will be modified as s/Paths.get/Path.of/.
>
> Alternative verbiage for the API Note in Paths might be:
>
> --- a/src/java.base/share/classes/java/nio/file/Paths.java
> +++ b/src/java.base/share/classes/java/nio/file/Paths.java
> @@ -33,9 +33,9 @@
>   * by converting a path string or {@link URI}.
>   *
>   * @apiNote
> - * This class is obsolete. Its {@code get()} methods simply invoke the
> - * equivalent static {@code of()} methods defined by {@link Path} 
> which should
> - * be used in preference.
> + * As of JDK 11, the preferred way to obtain a {@code Path} is 
> via the
> + * {@link Path#get(String,String...) Path.get(String, String...)} or
> + * {@link Path#get(URI) Path.get(URI)} methods.
>
> I will update the corresponding CSR according to the outcome of this 
> review thread.
>
> Thanks,
>
> Brian



More information about the nio-dev mailing list