On Wed, 8 Apr 2026 07:35:18 GMT, Alan Bateman <[email protected]> wrote:

> > Let's see what Alan/Jai have for a preference.
> 
> The Charset is used to encode entry names and comments so it's okay to say 
> that.
> 
> I see Eirik has inlined another patch. The class description part is okay 
> except for "uses UTF-8 to encode strings". 

I've pushed a change introducing the change in the class description, sans the 
"to encode strings" ending.

> For the same reason, I don't think the changes in the inlined patch to the 
> setComment and constructors should be included.

Looking at the constructor descriptions I noticed that they have identical and 
quite non-descript leading sentences. This means that constructor summaries end 
up saying just "Creates a new ZIP output stream" for both.

To figure out how they differ, you need to navigate to second paragraph for the 
1-arg constructor and to the `@param` description for the 2-arg constructors. 
This made me wonder if it would make sense to lift charset concerns into the 
leading sentence, making their difference more obvious sooner.

Somewhat unrelated or tangential to the change here though, just wanted to 
share the observation:


Index: src/java.base/share/classes/java/util/zip/ZipOutputStream.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java 
b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java
--- a/src/java.base/share/classes/java/util/zip/ZipOutputStream.java    
(revision b74e3c4cada4c5581b75c85370f06a0137fbc3b0)
+++ b/src/java.base/share/classes/java/util/zip/ZipOutputStream.java    (date 
1775637217668)
@@ -114,10 +114,9 @@
     public static final int DEFLATED = ZipEntry.DEFLATED;
 
     /**
-     * Creates a new ZIP output stream.
-     *
-     * <p>The UTF-8 {@link java.nio.charset.Charset charset} is used
-     * to encode the entry names and comments.
+     * Creates a new ZIP output stream using the UTF-8
+     * {@link java.nio.charset.Charset charset} to encode
+     * the entry names and comments.
      *
      * @param out the actual output stream
      */
@@ -126,7 +125,9 @@
     }
 
     /**
-     * Creates a new ZIP output stream.
+     * Creates a new ZIP output stream using the provided
+     * {@linkplain java.nio.charset.Charset charset} to encode
+     * the entry names and comments
      *
      * @param out the actual output stream
      *

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30338#discussion_r3050159546

Reply via email to