RFR: 8268613: jar --validate should check inital entries of a JAR file [v3]
Lance Andersen
lancea at openjdk.org
Tue Nov 11 19:21:03 UTC 2025
On Tue, 11 Nov 2025 19:09:38 GMT, Christian Stein <cstein at openjdk.org> wrote:
>> Please review this change to include a validation check for expecting an optional JAR manifest entry being the first or second entry in JAR file. As the second entry, it must be only preceeded by an entry for the `META-INF/` directory.
>
> Christian Stein has updated the pull request incrementally with one additional commit since the last revision:
>
> Move manifest location check to after the order mismatch validation
test/jdk/tools/jar/ValidatorTest.java line 342:
> 340: }
> 341:
> 342: private void testWrongManifestPosition(
This new test only validates that the LOC MANIFEST.MF entries are where they need to be. It does not do a similar CEN check in the event that the LOC and CEN entries do not match.
If you change your validation order so that Validator checks the MANIFEST location after it checks the order, then you should be covered.
I would also add a comment to the test to help future maintainers to the test ...
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28154#discussion_r2515410239
More information about the core-libs-dev
mailing list