RFR: 8374819: jpackage and jpackage tests leave some I/O streams unclosed [v2]

Alexander Matveev almatvee at openjdk.org
Fri Jan 9 23:18:44 UTC 2026


On Fri, 9 Jan 2026 03:21:12 GMT, Alexey Semenyuk <asemenyuk at openjdk.org> wrote:

>> - Replace `Files.newInputStream(path)` in chain method calls with either `new ByteArrayInputStream(Files.readAllBytes(path))` or `path.toFile()` if there is an alternative method taking a `File` instance instead of an `InputStream` and if appropriate.
>>  - Add missing try-with-resources for `Class.getResourceAsStream()` calls.
>
> Alexey Semenyuk has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - AppImageInfoPListFile: simplify
>  - Remove redundant "throws javax.xml.parsers.ParserConfigurationException" from PListReader#PListReader(byte[]) signature
>  - AppImageFile: add a comment explaining why we use javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream) and not javax.xml.parsers.DocumentBuilder#parse(java.io.File), even the later is more suitable for reading XML from a file

Looks good.

-------------

Marked as reviewed by almatvee (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29007#pullrequestreview-3645889188


More information about the core-libs-dev mailing list