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

Henry Jen henryjen at openjdk.org
Thu May 22 17:22:54 UTC 2025


On Wed, 14 May 2025 17:27:25 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> UTF-8 messed up the index, we don't want any conversion to happen.
>> Warning: Entry META-INFMAANIFEST.MF in local file header is not in central directory
>> Warning: Entry META-INF/BANIFEST.MF in local file header is not in central directory
>> Warning: Entry METAMINF/AANIFEST.MF in central directory is not in local file header
>> Warning: Entry METAMINF/BANIFEST.MF in central directory is not in local file header
>
>> UTF-8 messed up the index, we don't want any conversion to happen. Warning: Entry META-INFMAANIFEST.MF in local file header is not in central directory Warning: Entry META-INF/BANIFEST.MF in local file header is not in central directory Warning: Entry METAMINF/AANIFEST.MF in central directory is not in local file header Warning: Entry METAMINF/BANIFEST.MF in central directory is not in local file header
> 
> Without looking into this in finer detail I am not sure what the issue is and is why the other tests typically use the actual offset to modify.

Simply put, a byte in the bytearray could be extend to more than one byte with UTF-8. The base we start to looking for the character is recorded as in the bytearray. Thus could lead we start looking at wrong place. I didn't look into exactly how this happens.

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

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


More information about the core-libs-dev mailing list