On Tue, 24 Mar 2026 12:07:49 GMT, Eirik Bjørsnøs <[email protected]> wrote:
>> Please review this PR which updates the specification of
>> `ZipOutputStream.setComment(String)` to match the long-standing behavior of
>> throwing `IllegalArgumentException` when a comment contains characters which
>> are unmappable using the `Charset` passed in the constructor.
>>
>> A new tests is added to reproduce calling setComment with unmappable
>> characters and verify that it throws IAE.
>>
>> A CSR has been drafted. Its specification section will be updated after an
>> initial round of review of the specification text in this PR.
>
> Eirik Bjørsnøs has updated the pull request incrementally with one additional
> commit since the last revision:
>
> Lift null and empty string note into the method description
src/java.base/share/classes/java/util/zip/ZipOutputStream.java line 146:
> 144: * {@code null} then the output will have no ZIP file comment.
> 145: *
> 146: * @param comment the comment string, or an empty string or null
> for no comment
@AlanBateman To avoid the double "or", would something like the following work?
"the comment string, may be empty or null for no comment"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30338#discussion_r2981093256