ModuleReader should throw IOException consistently when using --patch-module and ModuleReader is closed

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 9
    • Component/s: core-libs
    • None

      Several methods on java.lang.module.ModuleReader are specified to thrown an IOException if invoked after the reader was closed:

      > @throws IOException If an I/O error occurs or the module reader is closed

      jdk.internal.module.ModulePatcher$PatchedModuleReader is an (internal) implementation of ModuleReader. Some of its methods throw an unspecified IllegalStateException when invoked after being closed:

      Caused by: java.lang.IllegalStateException: zip file closed
          at java.base/java.util.zip.ZipFile.ensureOpen(ZipFile.java:827)
          at java.base/java.util.zip.ZipFile.getEntry(ZipFile.java:290)
          at java.base/java.util.jar.JarFile.getEntry(JarFile.java:505)
          at java.base/java.util.jar.JarFile.getJarEntry(JarFile.java:460)
          at java.base/jdk.internal.module.ModulePatcher$JarResourceFinder.find(ModulePatcher.java:444)
          at java.base/jdk.internal.module.ModulePatcher$PatchedModuleReader.findResourceInPatch(ModulePatcher.java:301)
          at java.base/jdk.internal.module.ModulePatcher$PatchedModuleReader.find(ModulePatcher.java:357)

            Assignee:
            Jaikiran Pai
            Reporter:
            Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: