8242292: java.nio.file.FileSystems.getFileSystem(URI) should throw IAE if the URI's scheme is null

Alan Bateman Alan.Bateman at oracle.com
Wed Apr 8 07:11:50 UTC 2020


On 07/04/2020 21:22, Brian Burkhalter wrote:
>
> Here’s a version of the patch including a modified, existing test:
>
> http://cr.openjdk.java.net/~bpb/8242292/webrev.00/
>
> The impl change itself is the same.
>
The test doesn't look right quite because it creates a URI from a file 
path, I think this is closer to what you need here:

URI absoluteUri = Path.of("foo.bar").toUri();
URI relativeUri = URI.create(absoluteUri.getSchemeSpecificPart());
FileSystem fs = FileSystems.getFileSystem(relativeUri);

-Alan.


More information about the nio-dev mailing list