JDK 13 RFR of JDK-8223178: Improve FileSystems.newFileSystem example with map factory methods

Alan Bateman Alan.Bateman at oracle.com
Fri May 3 20:16:44 UTC 2019


On 01/05/2019 21:48, Joe Darcy wrote:

> I'd prefer to push a version without the explicit map variable, but 
> the max line length is slightly longer:
>
>       * <pre>
> -     *   Map<String,String> env = new HashMap<>();
> -     *   env.put("capacity", "16G");
> -     *   env.put("blockSize", "4k");
> -     *   FileSystem fs = 
> FileSystems.newFileSystem(URI.create("memory:///?name=logfs"), env);
> +     *  FileSystem fs = 
> FileSystems.newFileSystem(URI.create("memory:///?name=logfs"),
> +     * Map.of("capacity", "16G", "blockSize", "4k"));
>       * </pre>
This version looks okay too.

-Alan


More information about the nio-dev mailing list