On Tue, 7 Apr 2026 06:29:53 GMT, Alan Bateman <[email protected]> wrote:
>> Eirik Bjørsnøs has updated the pull request with a new target base due to a
>> merge or a rebase. The incremental webrev excludes the unrelated changes
>> brought in by the merge/rebase. The pull request contains nine additional
>> commits since the last revision:
>>
>> - Merge branch 'master' into zos-setcomment-unmappable
>> - Update copyright year
>> - Add null / empty string note to ZipEntry::setComment. Use "an empty
>> string" consistently.
>> - Lift null and empty string note into the method description
>> - Change "the empty string" to "an empty string"
>> - Remove unused import
>> - Add note to @param comment specification that the comment may be set to
>> null or the empty string to produce no ZIP file comment
>> - Update spec according to review suggestion
>> - Update ZipOutputStream.setComment to declare that it throws
>> IllegalArgumentException for unmappable characters in comment
>
> src/java.base/share/classes/java/util/zip/ZipOutputStream.java line 151:
>
>> 149: * ZIP file comment is greater than 0xFFFF bytes or if
>> the
>> 150: * {@code comment} contains characters that cannot be
>> mapped
>> 151: * by the {@code Charset} of this {@code ZipOutputStream}
>
> "the Charset of this ZipOutputStream". Maybe we can do better and say the
> Charset used to encode entry names and comments. This is because there is
> nothing in the ZipOutputStream class description that says anything about
> Charsets, one only learns about it when looking at the 2-arg constructor.
Yes, that "of this ZipOutputStream" does seem like a loose anchor. Better use
terms present in both constructors.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/30338#discussion_r3043979702