ModulePatcher$JarResourceFinder.getByteBuffer() does not close the InputStream after reading the bytes

XMLWordPrintable

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

      The implementation in jdk.internal.module.ModulePatcher$JarResourceFinder.getByteBuffer() currently gets a InputStream and reads all the bytes from it before returning those bytes as a ByteBuffer. However, the InputStream is never closed after these bytes have been read:

      byte[] bytes = getInputStream().readAllBytes();
      return ByteBuffer.wrap(bytes);

      The InputStream should be closed before returning from this method.

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

              Created:
              Updated:
              Resolved: