RFR: 8376403: Avoid loading ArrayDeque in java.util.zip.ZipFile [v2]

Eirik Bjørsnøs eirbjo at openjdk.org
Mon Jan 26 21:33:08 UTC 2026


> Hot on the heals of #29288, this PR replaces `ArrayDeque` with `ArrayList` for the Inflater cache implementation in `ZipFile.CleanableResource`.
> 
> With this PR, we change the order of the cache from a LIFO queue to a FIFO stack backed by ArrayList. The order seems unimportant, and has indeed been FIFO in the past when using `java.util.Vector`. Intuitively, it should be better to return the most recently used Inflater.
> 
> No tests updated, strict refactoring, `noreg-cleanup`.

Eirik Bjørsnøs has updated the pull request incrementally with one additional commit since the last revision:

  Remove uninitialized local variable

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/29430/files
  - new: https://git.openjdk.org/jdk/pull/29430/files/80bfe60d..a3f06cdc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29430&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29430&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/29430.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29430/head:pull/29430

PR: https://git.openjdk.org/jdk/pull/29430


More information about the core-libs-dev mailing list