RFR: 8374819: Some I/O streams left unclosed [v2]
Roger Riggs
rriggs at openjdk.org
Fri Jan 9 14:33:22 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
Can the title and description mention 'jpackage', please.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29007#issuecomment-3729148127
More information about the core-libs-dev
mailing list