You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2025/07/05 14:40:15 UTC
(commons-io) 12/20: Internal refactoring
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 a75744861057689bd10eb5a98cf6bb1826bc4aad
Author: Gary D. Gregory <ga...@gmail.com>
AuthorDate: Sat Jul 5 10:22:21 2025 -0400
Internal refactoring
---
.../org/apache/commons/io/input/UncheckedFilterReader.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/input/UncheckedFilterReader.java b/src/main/java/org/apache/commons/io/input/UncheckedFilterReader.java
index 2dbd587a8..db8529cab 100644
--- a/src/main/java/org/apache/commons/io/input/UncheckedFilterReader.java
+++ b/src/main/java/org/apache/commons/io/input/UncheckedFilterReader.java
@@ -91,11 +91,10 @@ public Builder() {
* @see #getReader()
* @see #getUnchecked()
*/
- @SuppressWarnings("resource")
@Override
public UncheckedFilterReader get() {
// This an unchecked class, so this method is as well.
- return Uncheck.get(() -> new UncheckedFilterReader(getReader()));
+ return Uncheck.get(() -> new UncheckedFilterReader(this));
}
}
@@ -112,11 +111,13 @@ public static Builder builder() {
/**
* Constructs a new filtered reader.
*
- * @param reader a Reader object providing the underlying stream.
+ * @param builder a Builder object providing the underlying stream.
+ * @throws IOException if an I/O error occurs.
* @throws NullPointerException if {@code reader} is {@code null}.
*/
- private UncheckedFilterReader(final Reader reader) {
- super(reader);
+ @SuppressWarnings("resource")
+ private UncheckedFilterReader(final Builder builder) throws IOException {
+ super(builder.getReader());
}
/**