RFR: 8377992: (zipfs) Align ZipFileSystem END header validation with the ZipFile implementation
Lance Andersen
lancea at openjdk.org
Thu Feb 19 17:14:42 UTC 2026
On Thu, 19 Feb 2026 16:34:55 GMT, Eirik Bjørsnøs <eirbjo at openjdk.org> wrote:
> > WRT the test, it is preferable that the ZipFS tests are added to open/test/jdk/jdk/nio/zipfs for now so that we have the specific tests co-located.
>
> The existing `EndOfCenValidation` test goes through some heroic efforts to create ZIP/ZIP64 files under reasonable size and efficiency constraints that provokes these edge-cases being tested.
>
> The reason I opted to expand the existing test with support for verifying `ZipFileSystem` was based on the following observations:
>
> * We want to ensure that validation for these cases is equivalent across APIs
> * Co-locating them avoids duplication of good amounts of intricate setup of test vectors
>
> Did you mean that we should copy this tests and maintain the copy separately in the `zipfs` area?
Understand WRT the zip creation logic. It can be easy to miss specific tests if they are not included in the primary test directory as there are times for example that you might only to need to run zipfs specific tests
So you could create a utility class which is shared by the ZipFile or ZipFs test or take the easier route of having a copy of the code in each directory.
I would probably error on the side of creating a utils directory and placing the specific shared code in a class there that is imported or extended...
I will defer to you on your preference though ;-)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/29747#issuecomment-3928618386
More information about the core-libs-dev
mailing list