This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 57d47cf65af65a4ab3e2769ee991ec685a0117c5 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Thu Apr 3 10:47:58 2025 -0400 Pass the class' builder internally --- .../apache/commons/io/output/UncheckedFilterOutputStream.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/apache/commons/io/output/UncheckedFilterOutputStream.java b/src/main/java/org/apache/commons/io/output/UncheckedFilterOutputStream.java index 4f8ca18e8..473beb889 100644 --- a/src/main/java/org/apache/commons/io/output/UncheckedFilterOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/UncheckedFilterOutputStream.java @@ -92,7 +92,7 @@ public Builder() { */ @Override public UncheckedFilterOutputStream get() throws IOException { - return new UncheckedFilterOutputStream(getOutputStream()); + return new UncheckedFilterOutputStream(this); } } @@ -109,11 +109,12 @@ public static Builder builder() { /** * Constructs an output stream filter built on top of the specified underlying output stream. * - * @param outputStream the underlying output stream, or {@code null} if this instance is to be created without an - * underlying stream. + * @param builder the buider. + * @throws IOException if an I/O error occurs converting to an {@link OutputStream} using {@link #getOutputStream()}. */ - private UncheckedFilterOutputStream(final OutputStream outputStream) { - super(outputStream); + @SuppressWarnings("resource") // Caller closes. + private UncheckedFilterOutputStream(final Builder builder) throws IOException { + super(builder.getOutputStream()); } /**