Skip to content

Commit

Permalink
Move the guidance to subclasses to the end() method
Browse files Browse the repository at this point in the history
  • Loading branch information
jaikiran committed Jan 14, 2025
1 parent 1cd16c4 commit 45bad0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/java.base/share/classes/java/util/zip/Deflater.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@
* @apiNote
* This class implements {@link AutoCloseable} to facilitate its usage with
* {@code try}-with-resources statement. The {@linkplain Deflater#close() close() method} simply
* calls {@code end()}. Subclasses should override {@linkplain #end()} to clean up the
* resources acquired by the subclass.
* calls {@code end()}.
*
* <p>
* The following code fragment demonstrates a trivial compression
Expand Down Expand Up @@ -889,6 +888,9 @@ public void reset() {
* <p>
* If the {@code Deflater} is already closed then invoking this method has no effect.
*
* @implSpec Subclasses should override this method to clean up the resources
* acquired by the subclass.
*
* @see #close()
*/
public void end() {
Expand Down
6 changes: 4 additions & 2 deletions src/java.base/share/classes/java/util/zip/Inflater.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@
* @apiNote
* This class implements {@link AutoCloseable} to facilitate its usage with
* {@code try}-with-resources statement. The {@linkplain Inflater#close() close() method} simply
* calls {@code end()}. Subclasses should override {@linkplain #end()} to clean up the
* resources acquired by the subclass.
* calls {@code end()}.
*
* <p>
* The following code fragment demonstrates a trivial compression
Expand Down Expand Up @@ -703,6 +702,9 @@ public void reset() {
* <p>
* If the {@code Inflater} is already closed then invoking this method has no effect.
*
* @implSpec Subclasses should override this method to clean up the resources
* acquired by the subclass.
*
* @see #close()
*/
public void end() {
Expand Down

0 comments on commit 45bad0e

Please sign in to comment.