diff --git a/src/main/java/org/apache/commons/lang3/function/Failable.java b/src/main/java/org/apache/commons/lang3/function/Failable.java index cdcfccce3..03db362ec 100644 --- a/src/main/java/org/apache/commons/lang3/function/Failable.java +++ b/src/main/java/org/apache/commons/lang3/function/Failable.java @@ -32,6 +32,7 @@ import java.util.function.Predicate; import java.util.function.Supplier; import java.util.stream.Stream; +import org.apache.commons.lang3.stream.Streams; import org.apache.commons.lang3.stream.Streams.FailableStream; /** @@ -522,11 +523,7 @@ public class Failable { } else { actualErrorHandler = errorHandler; } - if (resources != null) { - for (final FailableRunnable failableRunnable : resources) { - Objects.requireNonNull(failableRunnable, "runnable"); - } - } + Streams.of(resources).forEach(r -> Objects.requireNonNull(r, "runnable")); Throwable th = null; try { action.run();