RFR: 8303972: (zipfs) Make test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java independent of the zip command line

Eirik Bjørsnøs eirbjo at openjdk.org
Thu Feb 15 13:52:01 UTC 2024


Please review this PR which brings the currenly problem-listed test TestLocOffsetFromZip64EF back to life.

Instead of calling out to the `zip` command line, we produce a small-sized Zip64 file in the test itself. This file has the features  required to reproduce the ZipFileSystem issue, namely that the 'INFO-ZIP extended timestamp' field must come before  the 'Zip64 extended information'  field. (This would casue ZipFileSystem to read the LOC at position 0xFFFFFFFF).

This speed up the test (from 50s to 3s on my Macbook Pro), saves 4GB disk space during builds removes a dependency on the `zip` command in OS/distros.

Seee [JDK-8301183](https://bugs.openjdk.org/browse/JDK-8301183) for details on the problem-listing.

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

Commit messages:
 - Update constant ZIP64_SIZE to be the sum of EXTRA_HEADER_SIZE and ZIP64_DATA_SIZE
 - Merge branch 'master' into loc-offset-zip64-sparse
 - Convert test from testng to junit
 - Merge branch 'master' into loc-offset-zip64-sparse
 - Add a third DEFLATED entry to the test ZIP. Look up CEN offset from END header instead of skipping LOC headers. Add asserts that verifies that the ZIP has the expected entries.
 - Merge branch 'master' into loc-offset-zip64-sparse
 - Add extra entry as a sanity check. Extract some constants for sizes and extract method makeOpaqueExtraField to allow some more in-depth commenting. Move extra field processing until after the LOC headers are written, such that this information only occurs in the CEN
 - APPNOTE.txt actually specifies an 'unknown' tag, let's use that instead of 0x42
 - The Zip64 fields are all zero, we don't need to update them
 - Instead of making a big file to force Zip64, make a small file with a Zip64-formatted CEN header.
 - ... and 3 more: https://git.openjdk.org/jdk/compare/692c9f88...f845ff30

Changes: https://git.openjdk.org/jdk/pull/12979/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12979&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8303972
  Stats: 209 lines in 2 files changed: 90 ins; 44 del; 75 mod
  Patch: https://git.openjdk.org/jdk/pull/12979.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/12979/head:pull/12979

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


More information about the nio-dev mailing list