On Wed, 13 May 2026 06:53:28 GMT, Jaikiran Pai <[email protected]> wrote:
>> Can I please get a review of this doc and test-only change for >> https://bugs.openjdk.org/browse/JDK-8322256? >> >> The `java.util.zip.GZIPInputStream` has been in the JDK since Java 1.1. >> However, its specification hasn't been clear on how it behaves, especially >> when a `InputStream` consists of more than one GZIP member. >> >> The commit in this PR updates the specification of this class to match its >> current (long standing) implementation. >> >> A new jtreg test has been introduced to verify this behaviour. >> >> I'll draft a CSR shortly. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Jaikiran Pai 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 17 additional > commits since the last revision: > > - merge latest from master branch > - merge latest from master branch > - minor adjustments > - Lance's review > - merge latest from master branch > - introduce test to verify read() throws IOException when invoked on closed > stream > - specify existing behaviour of throwing IOException when stream is already > closed > - merge latest from master branch > - specify that GZIPInputStream is not thread-safe > - refer to section 2.2 of the RFC > - ... and 7 more: https://git.openjdk.org/jdk/compare/494a174d...a22c1b83 src/java.base/share/classes/java/util/zip/GZIPInputStream.java line 40: > 38: * > 39: * <h2><a id="gzip_file_format">GZIP file format</a></h2> > 40: * Section 2.2 of RFC-1952 specifies GZIP file format as consisting of a > series of "members" The RFC specifies the GZIP file format and it might be better to link to that first before jumping to section 2.2. Also it might be better to say that the members appear one after another before discussing what is in each member, e.g. "The GZIP file format is specified by RFC 1952. The format consists of a series of "members" that appear one after another in the stream with with no additional information before, between, or after. Each member consists of a header, followed by ...". src/java.base/share/classes/java/util/zip/GZIPInputStream.java line 121: > 119: * @throws NullPointerException if {@code in} is null > 120: * @throws IOException if an I/O error occurs when reading the > member header > 121: * from the underlying stream Are we guaranteeing that this will not attempt to read beyond the header? src/java.base/share/classes/java/util/zip/GZIPInputStream.java line 182: > 180: * @implSpec After reading a member trailer, this method calls > {@link InputStream#available()} > 181: * on the underlying stream to determine whether additional data is > available that may represent > 182: * a subsequent member. Who is the audience for this? Usually implSpec is aim at implementers/subclasses. Here I think this note is aimed at the user of the API that provides the input stream. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/30925#discussion_r3233554996 PR Review Comment: https://git.openjdk.org/jdk/pull/30925#discussion_r3233567713 PR Review Comment: https://git.openjdk.org/jdk/pull/30925#discussion_r3233579371
