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

Henry Jen henryjen at openjdk.org
Tue May 20 18:16:56 UTC 2025


On Tue, 20 May 2025 18:00:47 GMT, Lance Andersen <lancea at openjdk.org> wrote:

>> src/jdk.jartool/share/man/jar.md line 235:
>> 
>>> 233: 
>>> 234: The jar tool will return a status code of 0 if there were no integrity issues encountered and a
>>> 235: status code of 1 an issue was found. When an integrity issue is reported, it will often require
>> 
>> I am wondering if we should not explicitly said status code of 1 to be more flexible.
>> s/status code of 1/non-zero status code
>
>> I am wondering if we should not explicitly said status code of 1 to be more flexible. s/status code of 1/non-zero status code
> 
> Well, now would be a good time to consider say a value of 2 for duplicates, 3 for invalid names, etc...

We report all issues, not just one, so that would also involve what do we prioritized for the exit code...
In general, a non-zero code for invalid jar needs attention. We still 0 with unmatched order.
Also the process could fail with other issues like I/O or non-zip file.

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

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


More information about the core-libs-dev mailing list