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

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


On Thu, 22 May 2025 11:20:18 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> 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 185:
> 
>> 183:         // Encounter order in CEN, step by 1 on each new entry
>> 184:         int cenEncounterOrder = 0;
>> 185:         // Encounter order in LOC, step by 1 for new LOC entry exist in CEN
> 
> Nit - "for new LOC entry that exists in CEN"

I think the way you have implemented this is correct, but can you explain why we don't increment the `locEncounterOrder` for each LOC entry? I'm pretty sure I'll keep asking myself that question every time I see this code in future, so it would be good to have this clarified.

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

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


More information about the core-libs-dev mailing list