RFR: 8303972: Make test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java independent of the zip command line [v5]

Lance Andersen lancea at openjdk.org
Thu Mar 23 18:52:07 UTC 2023


On Fri, 17 Mar 2023 18:36:02 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:

>> 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.
>
> Eirik Bjorsnos has updated the pull request incrementally with one additional commit since the last revision:
> 
>   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

I think this looks good overall.   Please see the comment below and then I can run the test one more time and you should be good to go

test/jdk/jdk/nio/zipfs/TestLocOffsetFromZip64EF.java line 191:

> 189:             e.setExtra(zip64);
> 190: 
> 191:             zo.finish(); // Write out CEN and END records

I might add one more entry after this one, perhaps with a compression method of DEFLATED

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

Marked as reviewed by lancea (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/12979#pullrequestreview-1355345890
PR Review Comment: https://git.openjdk.org/jdk/pull/12979#discussion_r1146677274


More information about the nio-dev mailing list