File tree Expand file tree Collapse file tree
src/main/java/org/apache/commons/io/serialization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ public Builder accept(final String... patterns) {
188188 */
189189 @ Override
190190 public ValidatingObjectInputStream get () throws IOException {
191- return new ValidatingObjectInputStream (getInputStream (), predicate );
191+ return new ValidatingObjectInputStream (this );
192192 }
193193
194194 /**
@@ -276,6 +276,11 @@ public static Builder builder() {
276276
277277 private final ObjectStreamClassPredicate predicate ;
278278
279+ @ SuppressWarnings ("resource" ) // caller closes/
280+ private ValidatingObjectInputStream (final Builder builder ) throws IOException {
281+ this (builder .getInputStream (), builder .predicate );
282+ }
283+
279284 /**
280285 * Constructs an instance to deserialize the specified input stream. At least one accept method needs to be called to specify which classes can be
281286 * deserialized, as by default no classes are accepted.
You can’t perform that action at this time.
0 commit comments