On Fri, 20 Mar 2026 13:20:59 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. > > PR work revealed that setComment does not explicitly specify behavior if the > comment string is null or an empty string. The method spectifications of > `ZipOutputStream::setComment` and `ZipEntry::setComment` are updated to > clarify the consequences of such string values. > > A CSR has been drafted. Its specification section will be updated after an > initial round of review of the specification text in this PR. > > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: d89bd4c9 Author: Eirik Bjørsnøs <[email protected]> URL: https://git.openjdk.org/jdk/commit/d89bd4c9806a5893937950a27c8cf3aae352dce0 Stats: 80 lines in 3 files changed: 67 ins; 2 del; 11 mod 8380542: ZipOutputStream.setComment and ZipEntry.setComment spec updates for rejecting unmappable characters and allowing null or empty comments Reviewed-by: alanb, lancea, jpai ------------- PR: https://git.openjdk.org/jdk/pull/30338
