Skip to content

Commit ea6d7ca

Browse files
committed
Internal refactoring
1 parent 8850c79 commit ea6d7ca

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/main/java/org/apache/commons/io/input/UncheckedFilterInputStream.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.io.BufferedReader;
2121
import java.io.FilterInputStream;
2222
import java.io.IOException;
23-
import java.io.InputStream;
2423
import java.io.UncheckedIOException;
2524

2625
import org.apache.commons.io.build.AbstractStreamBuilder;
@@ -90,11 +89,10 @@ public Builder() {
9089
* @see #getInputStream()
9190
* @see #getUnchecked()
9291
*/
93-
@SuppressWarnings("resource")
9492
@Override
9593
public UncheckedFilterInputStream get() {
9694
// This an unchecked class, so this method is as well.
97-
return Uncheck.get(() -> new UncheckedFilterInputStream(getInputStream()));
95+
return Uncheck.get(() -> new UncheckedFilterInputStream(this));
9896
}
9997

10098
}
@@ -111,11 +109,12 @@ public static Builder builder() {
111109
/**
112110
* Constructs a {@link UncheckedFilterInputStream}.
113111
*
114-
* @param inputStream the underlying input stream, or {@code null} if this instance is to be created without an
115-
* underlying stream.
112+
* @param builder A builder providing the underlying input stream.
113+
* @throws IOException
116114
*/
117-
private UncheckedFilterInputStream(final InputStream inputStream) {
118-
super(inputStream);
115+
@SuppressWarnings("resource") // caller closes
116+
private UncheckedFilterInputStream(final Builder builder) throws IOException {
117+
super(builder.getInputStream());
119118
}
120119

121120
/**

0 commit comments

Comments
 (0)