Integrated: 8349909: jdk.internal.jimage.decompressor.ZipDecompressor does not close the Inflater in exceptional cases
Jaikiran Pai
jpai at openjdk.org
Mon Feb 17 11:09:21 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.
This pull request has now been integrated.
Changeset: 071c8f51
Author: Jaikiran Pai <jpai at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/071c8f515537d6030ae7055e309b4f4a6a495bc8
Stats: 11 lines in 1 file changed: 4 ins; 2 del; 5 mod
8349909: jdk.internal.jimage.decompressor.ZipDecompressor does not close the Inflater in exceptional cases
Reviewed-by: lancea, alanb
-------------
PR: https://git.openjdk.org/jdk/pull/23626
More information about the core-libs-dev
mailing list