More precise exceptions
MODIFY
src/main/java/org/apache/commons/io/IOUtils.java
src/main/java/org/apache/commons/io/IOUtils.java
@@ -391,10 +391,10 @@ public static void close(final Closeable closeable) throws IOException {
* Closes the given {@link Closeable}s as null-safe operations.
*
* @param closeables The resource(s) to close, may be null.
- * @throws IOException if an I/O error occurs.
+ * @throws IOExceptionList if an I/O error occurs.
* @since 2.8.0
*/
- public static void close(final Closeable... closeables) throws IOException {
+ public static void close(final Closeable... closeables) throws IOExceptionList {
IOConsumer.forAll(closeables, IOUtils::close);
}

MODIFY
src/test/java/org/apache/commons/io/IOUtilsTest.java
src/test/java/org/apache/commons/io/IOUtilsTest.java
@@ -338,8 +338,7 @@ public void testCloseMulti() {
assertDoesNotThrow(() -> IOUtils.close(closeables));
assertDoesNotThrow(() -> IOUtils.close((Closeable[]) null));
assertDoesNotThrow(() -> IOUtils.close(new StringReader("s"), nullCloseable));
- assertThrows(IOException.class,
- () -> IOUtils.close(nullCloseable, new ThrowOnCloseReader(new StringReader("s"))));
+ assertThrows(IOException.class, () -> IOUtils.close(nullCloseable, new ThrowOnCloseReader(new StringReader("s"))));
}
@Test

MODIFY
src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
import java.io.InputStream;
import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOExceptionList;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.RandomUtils;
import org.junit.jupiter.api.AfterEach;
@@ -53,7 +54,7 @@ public void setUp() throws IOException {
}
@AfterEach
- public void tearDown() throws IOException {
+ public void tearDown() throws IOExceptionList {
inputFile.delete();
IOUtils.close(inputStreams);
}

More precise exceptions