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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 26
    • 9
    • 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.

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

              Created:
              Updated:
              Resolved: