RFR: 8349909: jdk.internal.jimage.decompressor.ZipDecompressor does not close the Inflater in exceptional cases

Jaikiran Pai jpai at openjdk.org
Mon Feb 17 05:53:10 UTC 2025


On Fri, 14 Feb 2025 07:41:26 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

> Can I please get a review of this change which proposes to properly close the `Inflater` instance used in `jdk.internal.jimage.decompressor.ZipDecompressor.decompress()` method? This addresses https://bugs.openjdk.org/browse/JDK-8349909.
> 
> As noted in that issue, in the exceptional case in the `decompress()` method, the `Inflater` instance isn't currently being closed. The commit in this PR uses a try/finally block to `end()` the `Inflater` instance.
> 
> Unlike some other places within the JDK, the code in `jdk.internal.jimage.decompressor.ZipDecompressor` is expected to maintain Java 8 (API) compatibility, so this part of the code cannot use the newly introduced `Inflater.close()` method and thus cannot use the try-with-resources statement too.
> 
> No new tests have been added given the nature of this change. A noreg label has been added to the JBS issue. Existing tests in tier1, tier2 and tier3 continue to pass with this change.

Thank you Lance for the review. tier testing with this change has completed without any related failures.

Alan @AlanBateman, would it be OK to integrate this one?

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

PR Review: https://git.openjdk.org/jdk/pull/23626#pullrequestreview-2620084610


More information about the core-libs-dev mailing list