@@ -111,26 +111,26 @@ public static long copy(
111111 }
112112
113113 /**
114- * Executes lambda logic encapsulated in {@link IOExceptionThrowingRunnable } instances, suppressing
114+ * Executes lambda logic encapsulated in {@link ExceptionThrowingRunnable } instances, suppressing
115115 * and aggregating any {@link IOException} that occurs during execution. If any exceptions are thrown, they
116116 * are encapsulated and re-thrown as a single exception provided by the {@code exceptionFactory}.
117117 *
118118 * @param <T> the type of exception that will be thrown if any {@link IOException} occurs
119119 * @param exceptionFactory a supplier that provides an exception of type {@code T}, used to wrap any
120120 * {@link IOException} thrown during the execution of the provided runnables
121- * @param consumer varargs of {@link IOExceptionThrowingRunnable } instances which encapsulate
121+ * @param consumer varargs of {@link ExceptionThrowingRunnable } instances which encapsulate
122122 * the resources/actions to be closed or executed
123123 * @throws T the consolidated exception containing any {@link IOException}s that were
124124 * thrown by the provided runnables
125125 */
126126 public static <T extends RuntimeException > void executeSafely (
127127 @ Nonnull Supplier <T > exceptionFactory ,
128- @ Nonnull IOExceptionThrowingRunnable consumer
128+ @ Nonnull ExceptionThrowingRunnable consumer
129129 ) throws T {
130130 T exception = null ;
131131 try {
132132 consumer .run ();
133- } catch (IOException e ) {
133+ } catch (Exception e ) {
134134 exception = exceptionFactory .get ();
135135 exception .addSuppressed (e );
136136 }
@@ -179,7 +179,7 @@ public static <S, T extends RuntimeException> void executeSafely(
179179 * {@link IOException} thrown during the execution of the provided runnables
180180 * @param consumer varargs of {@link IOExceptionThrowingConsumer} instances which encapsulate
181181 * the resources/actions to be closed or executed
182- * @throws T the consolidated exception containing any {@link IOException }s that were
182+ * @throws U the consolidated exception containing any {@link Exception }s that were
183183 * thrown by the provided runnables
184184 */
185185 public static <S , T , U extends RuntimeException > void executeSafely (
@@ -234,24 +234,24 @@ public static <S, T extends RuntimeException> S executeSafely(
234234 }
235235
236236 /**
237- * Closes multiple resources encapsulated in {@link IOExceptionThrowingRunnable } instances, suppressing
237+ * Closes multiple resources encapsulated in {@link ExceptionThrowingRunnable } instances, suppressing
238238 * and aggregating any {@link IOException} that occurs during execution. If any exceptions are thrown, they
239239 * are encapsulated and re-thrown as a single exception provided by the {@code exceptionFactory}.
240240 *
241241 * @param <T> the type of exception that will be thrown if any {@link IOException} occurs
242242 * @param exceptionFactory a supplier that provides an exception of type {@code T}, used to wrap any
243243 * {@link IOException} thrown during the execution of the provided runnables
244- * @param runnable varargs of {@link IOExceptionThrowingRunnable } instances which encapsulate
244+ * @param runnable varargs of {@link ExceptionThrowingRunnable } instances which encapsulate
245245 * the resources/actions to be closed or executed
246246 * @throws T the consolidated exception containing any {@link IOException}s that were
247247 * thrown by the provided runnables
248248 */
249249 public static <T extends RuntimeException > void close (
250250 @ Nonnull Supplier <T > exceptionFactory ,
251- @ Nonnull IOExceptionThrowingRunnable ... runnable
251+ @ Nonnull ExceptionThrowingRunnable ... runnable
252252 ) throws T {
253253 T exception = null ;
254- for (IOExceptionThrowingRunnable lambda : runnable ) {
254+ for (ExceptionThrowingRunnable lambda : runnable ) {
255255 try {
256256 lambda .run ();
257257 } catch (Exception e ) {
@@ -269,7 +269,7 @@ public static <T extends RuntimeException> void close(
269269 * and aggregating any {@link Throwable} that occurs during execution. If any exceptions are thrown, they
270270 * are encapsulated and re-thrown as a single exception provided by the {@code exceptionFactory}.
271271 *
272- * Unlike {@link #close(Supplier, IOExceptionThrowingRunnable ...)}, this method catches any {@link Throwable}
272+ * Unlike {@link #close(Supplier, ExceptionThrowingRunnable ...)}, this method catches any {@link Throwable}
273273 * rather than just {@link Exception}, providing a more robust safety net for resource cleanup.
274274 *
275275 * @param <T> the type of exception that will be thrown if any exception occurs
@@ -299,7 +299,7 @@ public static <T extends RuntimeException> void closeSafely(
299299 }
300300
301301 /**
302- * Executes the provided {@link IOExceptionThrowingRunnable } instances, ensuring that exceptions thrown
302+ * Executes the provided {@link ExceptionThrowingRunnable } instances, ensuring that exceptions thrown
303303 * during their execution are logged but not propagated. This method is typically used for safely closing
304304 * resources without allowing individual close failures to disrupt the overall process.
305305 *
@@ -310,9 +310,9 @@ public static <T extends RuntimeException> void closeSafely(
310310 * @throws T if a runtime exception specific to the implementation needs propagation
311311 */
312312 public static <T extends RuntimeException > void closeQuietly (
313- @ Nonnull IOExceptionThrowingRunnable ... runnable
313+ @ Nonnull ExceptionThrowingRunnable ... runnable
314314 ) throws T {
315- for (IOExceptionThrowingRunnable lambda : runnable ) {
315+ for (ExceptionThrowingRunnable lambda : runnable ) {
316316 try {
317317 lambda .run ();
318318 } catch (Exception e ) {
@@ -327,7 +327,7 @@ public static <T extends RuntimeException> void closeQuietly(
327327 * during their execution are logged but not propagated. This method is typically used for safely closing
328328 * resources without allowing individual close failures to disrupt the overall process.
329329 *
330- * Unlike {@link #closeQuietly(IOExceptionThrowingRunnable ...)}, this method catches any {@link Throwable}
330+ * Unlike {@link #closeQuietly(ExceptionThrowingRunnable ...)}, this method catches any {@link Throwable}
331331 * rather than just {@link Exception}, providing a more robust safety net for resource cleanup.
332332 *
333333 * @param runnable the runnable instances, which may throw any exception during execution
@@ -351,25 +351,25 @@ public static <T extends RuntimeException> void closeSafely(
351351
352352 /**
353353 * Represents a functional interface that can be used to encapsulate a block of code
354- * that may throw an {@link IOException }. This interface is effectively a specialized
354+ * that may throw an {@link Exception }. This interface is effectively a specialized
355355 * form of {@link Runnable} for operations where checked I/O exceptions need to be handled.
356356 *
357357 * Implementations of this interface enable the execution of operations with the awareness
358- * and explicit handling of {@link IOException }. This is especially useful in scenarios
358+ * and explicit handling of {@link Exception }. This is especially useful in scenarios
359359 * where multiple such operations need to be executed or wrapped with exception aggregation,
360360 * for example, in utility methods like resource handling or cleanup.
361361 *
362362 * Method {@code run} is similar to the {@link Runnable#run()} method but allows an
363- * {@link IOException } to be thrown.
363+ * {@link Exception } to be thrown.
364364 *
365365 * Functional-style programming can make use of this interface to define inline behaviors
366- * for operations expected to throw {@link IOException }. It can also be integrated with
366+ * for operations expected to throw {@link Exception }. It can also be integrated with
367367 * various utility methods that leverage this interface for exception handling and resource management.
368368 */
369369 @ FunctionalInterface
370- public interface IOExceptionThrowingRunnable {
370+ public interface ExceptionThrowingRunnable {
371371
372- void run () throws IOException ;
372+ void run () throws Exception ;
373373
374374 }
375375
0 commit comments