On Thu, 27 Mar 2025 22:37:57 GMT, Chen Liang <li...@openjdk.org> wrote:
>> 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 12 additional >> commits since the last revision: >> >> - Lance's inputs >> - merge latest from master branch >> - merge latest from master branch >> - merge latest from master branch >> - additional updates to the doc >> - merge latest from master branch >> - change "@implSpec" to "@apiNote" and update their text >> - add class level documentation >> - merge latest from master branch >> - add tests >> - ... and 2 more: https://git.openjdk.org/jdk/compare/e5954bc5...ed7cf59e > > src/java.base/share/classes/java/util/zip/DeflaterInputStream.java line 40: > >> 38: * An {@linkplain DeflaterInputStream input stream} that is created >> without specifying >> 39: * a {@linkplain Deflater compressor} will use a default compressor. The >> default >> 40: * compressor will be closed when the input stream is {@linkplain #close >> closed}. > > Can we drop the second sentence > >> The default compressor will be closed when the input stream is closed. > > As this seems to be overspecification - it is totally legal for an > implementation to try to share a default compressor when it finds this > approach suitable, right? Hello Chen, > Can we drop the second sentence > > > The default compressor will be closed when the input stream is closed. > > As this seems to be overspecification - it is totally legal for an > implementation to try to share a default compressor when it finds this > approach suitable, right? The proposed javadoc is for the behaviour of the `DeflaterInputStream` (and of course the other 3 classes in this PR). So, I think, noting how this class manages the lifecycle of the default compressor is appropriate. It's true that the sub classes may do it differently, but that's also true for the case where a non-default compressor is passed to the constructor of these classes. Having said that, I follow what you are saying. This part about closing the default compressor probably shouldn't be in the formal specification and instead should be an `@apiNote`. I wonder if we should move that entire "Compressor/Decompressor usage" section under a `@apiNote` section at the class level. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23655#discussion_r2018289584