RFR: 8345431: Improve jar --validate to detect duplicate or invalid entries [v12]

Jaikiran Pai jpai at openjdk.org
Thu May 22 11:11:54 UTC 2025


On Thu, 22 May 2025 01:29:12 GMT, Henry Jen <henryjen at openjdk.org> wrote:

>> This PR check the jar file to ensure entries are consistent from the central directory and local file header. Also check there is no duplicate entry names that could override the desired content by accident.
>
> Henry Jen has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Validator to take a file, use term JAR file

src/jdk.jartool/share/classes/sun/tools/jar/Validator.java line 147:

> 145:     private class EntryValidator {
> 146:         // A place holder when an entry is not yet seen in the directory
> 147:         static EntryEncounter PLACE_HOLDER = new EntryEncounter(0, 0);

It looks like this could be `final`? And then `isPlaceHolder()` could just return `this == PLACE_HOLDER`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24430#discussion_r2102292540


More information about the core-libs-dev mailing list