RFR: 8345431: Improve jar --validate to detect duplicate or invalid entries [v11]
Lance Andersen
lancea at openjdk.org
Thu May 22 01:48:54 UTC 2025
On Thu, 22 May 2025 01:39:45 GMT, Henry Jen <henryjen at openjdk.org> wrote:
>>> Nit - we should call it exit code instead of status code, both for 0 and non-zero exit codes.
>>
>> I don't have a preference but unix/MacOS commands vary:
>>
>> - ls command: The ls utility exits 0 on success, and >0 if an error occurs.
>> - grep command:
>>
>>> The grep utility exits with one of the following values:
>>
>> 0 One or more lines were selected.
>> 1 No lines were selected.
>> >1 An error occurred.
>>
>> - unzip command:
>>
>>> The exit status (or error level) approximates the exit codes defined by PKWARE and takes on the
>> following values, except under VMS:
>>
>> 0 normal; no errors or warnings detected.
>>
>> 1 one or more warning errors were encountered, but processing completed successfully
>> anyway. This includes zipfiles where one or more files was skipped due to unsupported
>> compression method or encryption with an unknown password.
>>
>> 2 a generic error in the zipfile format was detected. Processing may have completed
>> successfully anyway; some broken zipfiles created by other archivers have simple work-
>> arounds.
>> 3 a severe error in the zipfile format was detected. Processing probably failed
>> immediately.
>>
>> 4 unzip was unable to allocate memory for one or more buffers during program
>> initialization.
>>
>> 5 unzip was unable to allocate memory or unable to obtain a tty to read the decryption
>> password(s).
>>
>> 6 unzip was unable to allocate memory during decompression to disk.
>>
>> 7 unzip was unable to allocate memory during in-memory decompression.
>>
>> 8 [currently not used]
>>
>> 9 the specified zipfiles were not found.
>>
>> 10 invalid options were specified on the command line.
>>
>> 11 no matching files were found.
>>
>> 50 the disk is (or was) full during extraction.
>>
>> 51 the end of the ZIP archive was encountered prematurely.
>>
>> 80 the user aborted unzip prematurely with control-C (or similar)
>>
>> 81 testing or extraction of one or more files failed due to unsupported compression methods
>> or unsupported decryption.
>>
>> ...
>
> I use exit code, but still keep non-zero instead of > 0. Leave that to future work if we want to have more specific value for exit code for different situations.
Non-zero could also mean negative which we currently do not do nor do,I see that going forward as part of future additions to validate
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24430#discussion_r2101463994
More information about the core-libs-dev
mailing list