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

Brian Burkhalter brian.burkhalter at oracle.com
Tue Apr 7 18:33:55 UTC 2020


Please review the change included below to address [1] in hope of shedding some light on [2].

Thanks,

Brian

[1] https://bugs.openjdk.java.net/browse/JDK-8242292
[2] https://bugs.openjdk.java.net/browse/JDK-8239569


@@ -226,6 +226,9 @@
      */
     public static FileSystem getFileSystem(URI uri) {
         String scheme = uri.getScheme();
+        if (scheme == null) {
+            throw new IllegalArgumentException(uri.toString());
+        }
         for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20200407/6172d51f/attachment.htm>


More information about the nio-dev mailing list