Skip to content

Commit 57d47cf

Browse files
committed
Pass the class' builder internally
1 parent 63a32f3 commit 57d47cf

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/main/java/org/apache/commons/io/output/UncheckedFilterOutputStream.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public Builder() {
9292
*/
9393
@Override
9494
public UncheckedFilterOutputStream get() throws IOException {
95-
return new UncheckedFilterOutputStream(getOutputStream());
95+
return new UncheckedFilterOutputStream(this);
9696
}
9797

9898
}
@@ -109,11 +109,12 @@ public static Builder builder() {
109109
/**
110110
* Constructs an output stream filter built on top of the specified underlying output stream.
111111
*
112-
* @param outputStream the underlying output stream, or {@code null} if this instance is to be created without an
113-
* underlying stream.
112+
* @param builder the buider.
113+
* @throws IOException if an I/O error occurs converting to an {@link OutputStream} using {@link #getOutputStream()}.
114114
*/
115-
private UncheckedFilterOutputStream(final OutputStream outputStream) {
116-
super(outputStream);
115+
@SuppressWarnings("resource") // Caller closes.
116+
private UncheckedFilterOutputStream(final Builder builder) throws IOException {
117+
super(builder.getOutputStream());
117118
}
118119

119120
/**

0 commit comments

Comments
 (0)