RFR: 8338931: ZipEntry.flags could be made internal to ZipOutputStream

Eirik Bjørsnøs eirbjo at openjdk.org
Sat Aug 24 12:51:32 UTC 2024


Please review this refactoring PR which moves the `ZipEntry.flags` field to `ZipOutputStream.XEntry`.

Moving this field will save four bytes from the `ZipEntry` object size and also saves an unneccessary read in `ZipFile.getZipEntry`.

Testing:

This PR is a refactoring of existing code and does not update any tests. I added the label `noreg-cleanup` to the JBS issue.

The following runs clean:


make test TEST="test/jdk/java/util/zip"
make test TEST="test/jdk/java/util/jar"


Performance:

The JMH benchmark `java.util.zip.ZipFileGetEntry.getEntryHit` show a small but consistent improvement (2-3%).

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

Commit messages:
 - Rename XEntry.flag to XEntry.flags
 - Move ZipEntry.flags to ZipOutputStream.XEntry

Changes: https://git.openjdk.org/jdk/pull/20702/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20702&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338931
  Stats: 13 lines in 3 files changed: 2 ins; 3 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/20702.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20702/head:pull/20702

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


More information about the core-libs-dev mailing list