Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257951

Module java.base - FileSystems::newFileSystem(Path) throws ProviderNotFoundException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • None
    • core-libs
    • inapplicable

      It's observed that the below code fails with ProviderNotFoundException when run with --limit-modules java.base, even though the code not referring any source outside java.base module. It passes with out any module restriction.

      public static void main(String[] args) {
              Path filePath = Path.of("file");
              try {
                  FileSystem fileSystem = FileSystems.newFileSystem(filePath);
                  System.out.println(" The fileSystem is " + fileSystem);
              } catch (IOException exception) {
                  exception.printStackTrace();
              } catch (ProviderNotFoundException ex) {
                  System.out.println(" Not expected : " + ex.getMessage());
              }
          }

            Unassigned Unassigned
            kganapureddy Krushnareddy Ganapureddy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: