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 2021/01/19 16:45:26 UTC

[commons-io] branch master updated (e3eade7 -> 1a72e52)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git.


    from e3eade7  Checkstyle left curly.
     new 8ca72fd  Oops, did not meet to commit those as part of the Javadoc cleanup.
     new 608cdb7  Remove unused import and unused exceptions.
     new 1a72e52  Remove unused exceptions and trailing whitespace.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/commons/io/DirectoryWalker.java     |   6 +-
 .../java/org/apache/commons/io/EndianUtils.java    |   2 +-
 src/main/java/org/apache/commons/io/FileUtils.java |  34 +++---
 .../java/org/apache/commons/io/FilenameUtils.java  |   2 +-
 src/main/java/org/apache/commons/io/IOUtils.java   |   8 +-
 .../java/org/apache/commons/io/StreamIterator.java |   2 +-
 .../commons/io/file/CountingPathVisitor.java       |   2 +-
 .../commons/io/file/DirectoryStreamFilter.java     |   2 +-
 .../java/org/apache/commons/io/file/PathUtils.java |   6 +-
 .../file/attribute/BasicFileAttributesPrinter.java | 124 -------------------
 .../apache/commons/io/file/attribute/package.html  |  22 ----
 .../io/filefilter/AbstractMethodFileFilter.java    |  56 ---------
 .../commons/io/filefilter/AndFileFilter.java       |   4 +-
 .../commons/io/filefilter/FalseFileFilter.java     |   2 +-
 .../commons/io/filefilter/FileVisitorMethod.java   |  51 --------
 .../apache/commons/io/filefilter/OrFileFilter.java |   4 +-
 .../io/filefilter/PathEqualsFileFilter.java        |   2 +-
 .../io/filefilter/PrintStreamFileFilter.java       | 135 ---------------------
 .../commons/io/filefilter/TrueFileFilter.java      |   2 +-
 .../io/input/BufferedFileChannelInputStream.java   |   2 +-
 .../apache/commons/io/input/QueueInputStream.java  |  16 +--
 .../commons/io/input/ReadAheadInputStream.java     |   2 +-
 .../commons/io/input/ReversedLinesFileReader.java  |   6 +-
 .../commons/io/input/SwappedDataInputStream.java   |  26 ++--
 .../io/input/buffer/CircularBufferInputStream.java |   4 +-
 .../commons/io/output/QueueOutputStream.java       |  12 +-
 .../org/apache/commons/io/FileUtilsTestCase.java   |  43 ++++---
 .../io/comparator/DefaultFileComparatorTest.java   |   2 +-
 .../io/comparator/DirectoryFileComparatorTest.java |   2 +-
 .../io/comparator/ExtensionFileComparatorTest.java |   2 +-
 .../io/comparator/NameFileComparatorTest.java      |   2 +-
 .../io/comparator/PathFileComparatorTest.java      |   2 +-
 .../attribute/BasicFileAttributesPrinterTest.java  |  31 -----
 .../ConditionalFileFilterAbstractTestCase.java     |   8 +-
 .../filefilter/IOFileFilterAbstractTestCase.java   |   9 +-
 .../io/filefilter/RegexFileFilterTestCase.java     |   6 +-
 .../commons/io/input/AbstractInputStreamTest.java  |   2 +-
 .../commons/io/input/BOMInputStreamTest.java       |   3 +-
 .../commons/io/input/QueueInputStreamTest.java     |   2 +-
 .../io/input/RandomAccessFileInputStreamTest.java  |   2 +-
 .../org/apache/commons/io/input/TailerTest.java    |   2 +-
 .../org/apache/commons/io/input/TeeReaderTest.java |   4 +-
 .../io/monitor/FileAlterationObserverTestCase.java |  16 +--
 .../io/output/AppendableOutputStreamTest.java      |   2 +-
 .../commons/io/output/AppendableWriterTest.java    |   2 +-
 .../commons/io/output/ClosedOutputStreamTest.java  |   6 +-
 .../apache/commons/io/output/ClosedWriterTest.java |   6 +-
 .../commons/io/output/QueueOutputStreamTest.java   |   2 +-
 .../io/serialization/FullClassNameMatcherTest.java |   4 +-
 .../ValidatingObjectInputStreamTest.java           |   4 +-
 50 files changed, 132 insertions(+), 566 deletions(-)
 delete mode 100644 src/main/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinter.java
 delete mode 100644 src/main/java/org/apache/commons/io/file/attribute/package.html
 delete mode 100644 src/main/java/org/apache/commons/io/filefilter/AbstractMethodFileFilter.java
 delete mode 100644 src/main/java/org/apache/commons/io/filefilter/FileVisitorMethod.java
 delete mode 100644 src/main/java/org/apache/commons/io/filefilter/PrintStreamFileFilter.java
 delete mode 100644 src/test/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinterTest.java


[commons-io] 01/03: Oops, did not meet to commit those as part of the Javadoc cleanup.

Posted by gg...@apache.org.
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 8ca72fde228b8f78f39e7ca96e82d263a3141808
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jan 19 11:19:48 2021 -0500

    Oops, did not meet to commit those as part of the Javadoc cleanup.
---
 .../file/attribute/BasicFileAttributesPrinter.java | 124 -------------------
 .../apache/commons/io/file/attribute/package.html  |  22 ----
 .../io/filefilter/AbstractMethodFileFilter.java    |  56 ---------
 .../commons/io/filefilter/FileVisitorMethod.java   |  51 --------
 .../io/filefilter/PrintStreamFileFilter.java       | 135 ---------------------
 .../attribute/BasicFileAttributesPrinterTest.java  |  31 -----
 6 files changed, 419 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinter.java b/src/main/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinter.java
deleted file mode 100644
index eb63101..0000000
--- a/src/main/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinter.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.io.file.attribute;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.Objects;
-
-import org.apache.commons.io.file.PathUtils;
-
-/**
- * Prints {@link BasicFileAttributes} allowing for custom formats.
- * 
- * @since 2.9.0
- */
-public class BasicFileAttributesPrinter {
-
-    /**
-     * Prints the {@link BasicFileAttributes} for the given {@link Path} strings.
-     * 
-     * @param args {@link Path} strings.
-     */
-    public static void main(String[] args) {
-        for (String arg : args) {
-            try {
-                final Path path = Paths.get(arg);
-                System.out.print(path);
-                System.out.print(": ");
-                System.out.println(toString(readBasicFileAttributes(path)));
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    private static BasicFileAttributes readBasicFileAttributes(final Path path) throws IOException {
-        return PathUtils.readBasicFileAttributes(path);
-    }
-
-    private static final String FORMAT_FULL = "D%s O%s F%s S%s %s %s %s %,9d %s";
-    private static final String FORMAT_FILE = "S%s %s %s %s %,9d %s";
-    private static final String FORMAT_DIR = "S%s %s %s %s %,9d %s";
-    private static final String EMPTY = "";
-
-    private static char toSign(final boolean value) {
-        return toSign(value, '+', '-');
-    }
-
-    private static char toSign(final boolean value, char trueChar, char falseChar) {
-        return value ? trueChar : falseChar;
-    }
-
-    public static String toDirString(final BasicFileAttributes attributes) {
-        if (attributes == null) {
-            return EMPTY;
-        }
-        // Convert FileTime to instant for constant-width formatting.
-        // @formatter:off
-        return String.format(FORMAT_DIR,
-            toSign(attributes.isSymbolicLink()),
-            attributes.creationTime().toInstant(),
-            attributes.lastAccessTime().toInstant(),
-            attributes.lastModifiedTime().toInstant(),
-            attributes.size(),
-            Objects.toString(attributes.fileKey(), EMPTY)
-        );
-        // @formatter:on
-    }
-
-    public static String toFileString(final BasicFileAttributes attributes) {
-        if (attributes == null) {
-            return EMPTY;
-        }
-        // Convert FileTime to instant for constant-width formatting.
-        // @formatter:off
-        return String.format(FORMAT_FILE,
-            toSign(attributes.isSymbolicLink()),
-            attributes.creationTime().toInstant(),
-            attributes.lastAccessTime().toInstant(),
-            attributes.lastModifiedTime().toInstant(),
-            attributes.size(),
-            Objects.toString(attributes.fileKey(), EMPTY)
-        );
-        // @formatter:on
-    }
-
-    public static String toString(final BasicFileAttributes attributes) {
-        if (attributes == null) {
-            return EMPTY;
-        }
-        // Convert FileTime to instant for constant-width formatting.
-        // @formatter:off
-        return String.format(FORMAT_FULL,
-            toSign(attributes.isDirectory()),
-            toSign(attributes.isOther()),
-            toSign(attributes.isRegularFile()),
-            toSign(attributes.isSymbolicLink()),
-            attributes.creationTime().toInstant(),
-            attributes.lastAccessTime().toInstant(),
-            attributes.lastModifiedTime().toInstant(),
-            attributes.size(),
-            Objects.toString(attributes.fileKey(), EMPTY)
-        );
-        // @formatter:on
-    }
-
-}
diff --git a/src/main/java/org/apache/commons/io/file/attribute/package.html b/src/main/java/org/apache/commons/io/file/attribute/package.html
deleted file mode 100644
index 10ef237..0000000
--- a/src/main/java/org/apache/commons/io/file/attribute/package.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<html>
-<body>
-	<p>This package provides extensions in the realm of java.nio.file.attribute.</p>
-</body>
-</html>
diff --git a/src/main/java/org/apache/commons/io/filefilter/AbstractMethodFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/AbstractMethodFileFilter.java
deleted file mode 100644
index b3542ff..0000000
--- a/src/main/java/org/apache/commons/io/filefilter/AbstractMethodFileFilter.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.io.filefilter;
-
-import java.util.Arrays;
-
-public abstract class AbstractMethodFileFilter extends AbstractFileFilter {
-
-    private final boolean checkDirPost;
-    private final boolean checkDirPre;
-    private final boolean checkFile;
-    private final boolean checkFileFailed;
-
-    public AbstractMethodFileFilter(final FileVisitorMethod... fileVisitorMethod) {
-        final FileVisitorMethod[] actual = (fileVisitorMethod == null || fileVisitorMethod.length == 0
-            ? FileVisitorMethod.values()
-            : fileVisitorMethod).clone();
-        Arrays.sort(actual);
-        this.checkFile = Arrays.binarySearch(actual, FileVisitorMethod.FILE) >= 0;
-        this.checkFileFailed = Arrays.binarySearch(actual, FileVisitorMethod.FILE_FAILED) >= 0;
-        this.checkDirPre = Arrays.binarySearch(actual, FileVisitorMethod.PRE_DIR) >= 0;
-        this.checkDirPost = Arrays.binarySearch(actual, FileVisitorMethod.POST_DIR) >= 0;
-
-    }
-
-    public boolean isCheckDirPost() {
-        return checkDirPost;
-    }
-
-    public boolean isCheckDirPre() {
-        return checkDirPre;
-    }
-
-    public boolean isCheckFile() {
-        return checkFile;
-    }
-
-    public boolean isCheckFileFailed() {
-        return checkFileFailed;
-    }
-}
diff --git a/src/main/java/org/apache/commons/io/filefilter/FileVisitorMethod.java b/src/main/java/org/apache/commons/io/filefilter/FileVisitorMethod.java
deleted file mode 100644
index e51d3e6..0000000
--- a/src/main/java/org/apache/commons/io/filefilter/FileVisitorMethod.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.io.filefilter;
-
-import java.io.IOException;
-import java.nio.file.FileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-
-/**
- * Enumerates visitation methods from {@link FileVisitor}.
- * 
- * @since 2.9.0
- * @see FileVisitor
- */
-public enum FileVisitorMethod {
-
-    /**
-     * Matches {@link FileVisitor#visitFile(Object, BasicFileAttributes)}.
-     */
-    FILE,
-
-    /**
-     * Matches {@link FileVisitor#visitFileFailed(Object, IOException)}.
-     */
-    FILE_FAILED,
-
-    /**
-     * Matches {@link FileVisitor#postVisitDirectory(Object, IOException)}.
-     */
-    POST_DIR,
-
-    /**
-     * Matches {@link FileVisitor#preVisitDirectory(Object, BasicFileAttributes)}.
-     */
-    PRE_DIR
-}
\ No newline at end of file
diff --git a/src/main/java/org/apache/commons/io/filefilter/PrintStreamFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/PrintStreamFileFilter.java
deleted file mode 100644
index 1b98228..0000000
--- a/src/main/java/org/apache/commons/io/filefilter/PrintStreamFileFilter.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.io.filefilter;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.attribute.BasicFileAttributes;
-
-import org.apache.commons.io.file.PathUtils;
-import org.apache.commons.io.file.attribute.BasicFileAttributesPrinter;
-
-public class PrintStreamFileFilter extends AbstractMethodFileFilter {
-
-    public static void main(final String[] args) {
-        final Path directory = args.length == 0 ? PathUtils.current() : Paths.get(args[0]);
-        try {
-            PathUtils.visitFileTree(PrintStreamFileFilter.systemOut(), directory);
-        } catch (final IOException e) {
-            e.printStackTrace();
-        }
-    }
-
-    public static PrintStreamFileFilter systemOut() {
-        return new PrintStreamFileFilter(System.out, FileVisitorMethod.FILE, FileVisitorMethod.PRE_DIR);
-    }
-
-    private final String dirPostExFormat = "Post %s: %s%n";
-    private final String dirPostFormat = "Directory: %s%n";
-    private final String dirPreAttrFormat = "Directory: %s %s%n";
-    private final String dirPreFormat = "Pre %s%n";
-    private final String fileAttrFormat = "%s %s%n";
-    private final String fileFailFormat = "%s: %s%n";
-    private final String fileFormat = "%s%n";
-    private final boolean printAttributes;
-    private final PrintStream printStream;
-
-    public PrintStreamFileFilter(final PrintStream printStream, final FileVisitorMethod... fileVisitorMethod) {
-        super(fileVisitorMethod);
-        this.printStream = printStream;
-        this.printAttributes = true;
-    }
-
-    @Override
-    public boolean accept(final File file) {
-        if (isCheckFile()) {
-            printFile(file, null);
-        }
-        return true;
-    }
-
-    @Override
-    protected FileVisitResult handle(final Throwable t) {
-        printStream.println(t);
-        return FileVisitResult.TERMINATE;
-    }
-
-    @Override
-    public FileVisitResult accept(final Path file, final BasicFileAttributes attributes) {
-        if (isCheckFile()) {
-            printFile(file, attributes);
-        }
-        return FileVisitResult.CONTINUE;
-    }
-
-    @Override
-    public FileVisitResult postVisitDirectory(final Path dir, final IOException exc) throws IOException {
-        if (isCheckDirPost()) {
-            if (exc == null) {
-                printStream.printf(dirPostFormat, dir);
-            } else {
-                printStream.printf(dirPostExFormat, dir, exc);
-            }
-        }
-        return FileVisitResult.CONTINUE;
-    }
-
-    @Override
-    public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attributes) throws IOException {
-        if (isCheckDirPre()) {
-            if (printAttributes(attributes)) {
-                printStream.printf(dirPreFormat, dir);
-            } else {
-                printStream.printf(dirPreAttrFormat, dir, BasicFileAttributesPrinter.toFileString(attributes));
-            }
-        }
-        return FileVisitResult.CONTINUE;
-    }
-
-    private boolean printAttributes(final BasicFileAttributes attributes) {
-        return attributes == null || !printAttributes;
-    }
-
-    private void printFile(final Object file, final BasicFileAttributes attributes) {
-        if (printAttributes(attributes)) {
-            printStream.printf(fileFormat, file);
-        } else {
-            printStream.printf(fileAttrFormat, BasicFileAttributesPrinter.toFileString(attributes), file);
-        }
-    }
-
-    @Override
-    public FileVisitResult visitFile(final Path file, final BasicFileAttributes attributes) throws IOException {
-        if (isCheckFile()) {
-            printFile(file, attributes);
-        }
-        return FileVisitResult.CONTINUE;
-    }
-
-    @Override
-    public FileVisitResult visitFileFailed(final Path file, final IOException exc) throws IOException {
-        if (isCheckFileFailed()) {
-            printStream.printf(fileFailFormat, file, exc);
-        }
-        return FileVisitResult.CONTINUE;
-    }
-}
diff --git a/src/test/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinterTest.java b/src/test/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinterTest.java
deleted file mode 100644
index 1ef4253..0000000
--- a/src/test/java/org/apache/commons/io/file/attribute/BasicFileAttributesPrinterTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.commons.io.file.attribute;
-
-import org.junit.jupiter.api.Test;
-
-/**
- * Tests {@link BasicFileAttributesPrinter}.
- */
-public class BasicFileAttributesPrinterTest {
-
-    @Test
-    public void test() {
-        
-    }
-}


[commons-io] 02/03: Remove unused import and unused exceptions.

Posted by gg...@apache.org.
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 608cdb781493040168d594befe0ee061f840876b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jan 19 11:21:49 2021 -0500

    Remove unused import and unused exceptions.
---
 .../java/org/apache/commons/io/FileUtilsTestCase.java | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
index b41e483..2192e26 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
@@ -39,7 +39,6 @@ import java.math.BigInteger;
 import java.net.URL;
 import java.nio.charset.Charset;
 import java.nio.charset.StandardCharsets;
-import java.nio.file.CopyOption;
 import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.StandardCopyOption;
@@ -168,7 +167,7 @@ public class FileUtilsTestCase {
 
     private long testFile2Size;
 
-    private void backDateFile10Minutes(final File testFile) throws IOException {
+    private void backDateFile10Minutes(final File testFile) {
         final long mins10 = 1000 * 60 * 10;
         final long lastModified1 = getLastModifiedMillis(testFile);
         assertTrue(setLastModifiedMillis(testFile, lastModified1 - mins10));
@@ -217,7 +216,7 @@ public class FileUtilsTestCase {
         FileUtils.writeStringToFile(file6, "File 6 in grandChild2", "UTF8");
     }
 
-    private long getLastModifiedMillis(final File file) throws IOException {
+    private long getLastModifiedMillis(final File file) {
         return file.lastModified();
         //https://bugs.openjdk.java.net/browse/JDK-8177809
         //return Files.getLastModifiedTime(file.toPath()).toMillis();
@@ -331,14 +330,14 @@ public class FileUtilsTestCase {
     }
 
     @Test
-    public void test_openInputStream_existsButIsDirectory() throws Exception {
+    public void test_openInputStream_existsButIsDirectory() {
         final File directory = new File(temporaryFolder, "subdir");
         directory.mkdirs();
         assertThrows(IOException.class, () -> FileUtils.openInputStream(directory));
     }
 
     @Test
-    public void test_openInputStream_notExists() throws Exception {
+    public void test_openInputStream_notExists() {
         final File directory = new File(temporaryFolder, "test.txt");
         try (FileInputStream in = FileUtils.openInputStream(directory)) {
             fail();
@@ -358,7 +357,7 @@ public class FileUtilsTestCase {
     }
 
     @Test
-    public void test_openOutputStream_existsButIsDirectory() throws Exception {
+    public void test_openOutputStream_existsButIsDirectory() {
         final File directory = new File(temporaryFolder, "subdir");
         directory.mkdirs();
         assertThrows(IllegalArgumentException.class, () -> FileUtils.openOutputStream(directory));
@@ -384,7 +383,7 @@ public class FileUtilsTestCase {
     }
 
     @Test
-    public void test_openOutputStream_notExistsCannotCreate() throws Exception {
+    public void test_openOutputStream_notExistsCannotCreate() {
         // according to Wikipedia, most filing systems have a 256 limit on filename
         final String longStr =
                 "abcdevwxyzabcdevwxyzabcdevwxyzabcdevwxyzabcdevwxyz" +
@@ -710,7 +709,7 @@ public class FileUtilsTestCase {
     }
 
     @Test
-    public void testCopyDirectoryExceptions() throws Exception {
+    public void testCopyDirectoryExceptions() {
         //
         // NullPointerException
         assertThrows(NullPointerException.class, () -> FileUtils.copyDirectory(null, null));
@@ -1565,7 +1564,7 @@ public class FileUtilsTestCase {
 
     // This test relies on FileUtils.copyFile using File.length to check the output size
     @Test
-    public void testIncorrectOutputSize() throws Exception {
+    public void testIncorrectOutputSize() {
         final File inFile = new File("pom.xml");
         final File outFile = new ShorterFile("target/pom.tmp"); // it will report a shorter file
         try {
@@ -1590,7 +1589,7 @@ public class FileUtilsTestCase {
     }
 
     @Test
-    public void testIO300() throws Exception {
+    public void testIO300() {
         final File testDirectory = temporaryFolder;
         final File src = new File(testDirectory, "dir1");
         final File dest = new File(src, "dir2");


[commons-io] 03/03: Remove unused exceptions and trailing whitespace.

Posted by gg...@apache.org.
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 1a72e52157e1b58c1a3aa25282ec69210443d594
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Jan 19 11:45:21 2021 -0500

    Remove unused exceptions and trailing whitespace.
---
 .../org/apache/commons/io/DirectoryWalker.java     |  6 ++--
 .../java/org/apache/commons/io/EndianUtils.java    |  2 +-
 src/main/java/org/apache/commons/io/FileUtils.java | 34 +++++++++++-----------
 .../java/org/apache/commons/io/FilenameUtils.java  |  2 +-
 src/main/java/org/apache/commons/io/IOUtils.java   |  8 ++---
 .../java/org/apache/commons/io/StreamIterator.java |  2 +-
 .../commons/io/file/CountingPathVisitor.java       |  2 +-
 .../commons/io/file/DirectoryStreamFilter.java     |  2 +-
 .../java/org/apache/commons/io/file/PathUtils.java |  6 ++--
 .../commons/io/filefilter/AndFileFilter.java       |  4 +--
 .../commons/io/filefilter/FalseFileFilter.java     |  2 +-
 .../apache/commons/io/filefilter/OrFileFilter.java |  4 +--
 .../io/filefilter/PathEqualsFileFilter.java        |  2 +-
 .../commons/io/filefilter/TrueFileFilter.java      |  2 +-
 .../io/input/BufferedFileChannelInputStream.java   |  2 +-
 .../apache/commons/io/input/QueueInputStream.java  | 16 +++++-----
 .../commons/io/input/ReadAheadInputStream.java     |  2 +-
 .../commons/io/input/ReversedLinesFileReader.java  |  6 ++--
 .../commons/io/input/SwappedDataInputStream.java   | 26 ++++++++---------
 .../io/input/buffer/CircularBufferInputStream.java |  4 +--
 .../commons/io/output/QueueOutputStream.java       | 12 ++++----
 .../org/apache/commons/io/FileUtilsTestCase.java   | 24 +++++++--------
 .../io/comparator/DefaultFileComparatorTest.java   |  2 +-
 .../io/comparator/DirectoryFileComparatorTest.java |  2 +-
 .../io/comparator/ExtensionFileComparatorTest.java |  2 +-
 .../io/comparator/NameFileComparatorTest.java      |  2 +-
 .../io/comparator/PathFileComparatorTest.java      |  2 +-
 .../ConditionalFileFilterAbstractTestCase.java     |  8 ++---
 .../filefilter/IOFileFilterAbstractTestCase.java   |  9 ++----
 .../io/filefilter/RegexFileFilterTestCase.java     |  6 ++--
 .../commons/io/input/AbstractInputStreamTest.java  |  2 +-
 .../commons/io/input/BOMInputStreamTest.java       |  3 +-
 .../commons/io/input/QueueInputStreamTest.java     |  2 +-
 .../io/input/RandomAccessFileInputStreamTest.java  |  2 +-
 .../org/apache/commons/io/input/TailerTest.java    |  2 +-
 .../org/apache/commons/io/input/TeeReaderTest.java |  4 +--
 .../io/monitor/FileAlterationObserverTestCase.java | 16 ++++------
 .../io/output/AppendableOutputStreamTest.java      |  2 +-
 .../commons/io/output/AppendableWriterTest.java    |  2 +-
 .../commons/io/output/ClosedOutputStreamTest.java  |  6 ++--
 .../apache/commons/io/output/ClosedWriterTest.java |  6 ++--
 .../commons/io/output/QueueOutputStreamTest.java   |  2 +-
 .../io/serialization/FullClassNameMatcherTest.java |  4 +--
 .../ValidatingObjectInputStreamTest.java           |  4 +--
 44 files changed, 123 insertions(+), 137 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/DirectoryWalker.java b/src/main/java/org/apache/commons/io/DirectoryWalker.java
index 1b391b2..4270cf8 100644
--- a/src/main/java/org/apache/commons/io/DirectoryWalker.java
+++ b/src/main/java/org/apache/commons/io/DirectoryWalker.java
@@ -49,7 +49,7 @@ import org.apache.commons.io.filefilter.TrueFileFilter;
  *
  * There are many possible extensions, for example, to delete all files and '.svn' directories, and return a list of
  * deleted files:
- * 
+ *
  * <pre>
  * public class FileCleaner extends DirectoryWalker {
  *
@@ -98,7 +98,7 @@ import org.apache.commons.io.filefilter.TrueFileFilter;
  * <p>
  * For example, if you wanted all directories which are not hidden and files which end in ".txt":
  * </p>
- * 
+ *
  * <pre>
  * public class FooDirectoryWalker extends DirectoryWalker {
  *     public FooDirectoryWalker(FileFilter filter) {
@@ -129,7 +129,7 @@ import org.apache.commons.io.filefilter.TrueFileFilter;
  * <p>
  * For example, if you wanted all directories which are not hidden and files which end in ".txt":
  * </p>
- * 
+ *
  * <pre>
  *  public class FooDirectoryWalker extends DirectoryWalker {
  *    public FooDirectoryWalker(IOFileFilter dirFilter, IOFileFilter fileFilter) {
diff --git a/src/main/java/org/apache/commons/io/EndianUtils.java b/src/main/java/org/apache/commons/io/EndianUtils.java
index 5d2e294..849f86b 100644
--- a/src/main/java/org/apache/commons/io/EndianUtils.java
+++ b/src/main/java/org/apache/commons/io/EndianUtils.java
@@ -304,7 +304,7 @@ public class EndianUtils {
 
     /**
      * Writes a "int" value to an OutputStream. The value is converted to the opposed endian system while writing.
-     * 
+     *
      * @param output target OutputStream
      * @param value value to write
      * @throws IOException in case of an I/O problem
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index fc2eb0f..0ad361b 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -246,7 +246,7 @@ public class FileUtils {
     /**
      * Computes the checksum of a file using the specified checksum object. Multiple files may be checked using one
      * {@code Checksum} instance if desired simply by reusing the same checksum object. For example:
-     * 
+     *
      * <pre>
      * long checksum = FileUtils.checksum(file, new CRC32()).getValue();
      * </pre>
@@ -525,14 +525,14 @@ public class FileUtils {
      * modification operation fails, the methods throws IOException.
      * </p>
      * <b>Example: Copy directories only</b>
-     * 
+     *
      * <pre>
      * // only copy the directory structure
      * FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY);
      * </pre>
      *
      * <b>Example: Copy directories and txt files</b>
-     * 
+     *
      * <pre>
      * // Create a filter for ".txt" files
      * IOFileFilter txtSuffixFilter = FileFilterUtils.suffixFileFilter(".txt");
@@ -574,14 +574,14 @@ public class FileUtils {
      * will succeed. If the modification operation fails, the methods throws IOException.
      * </p>
      * <b>Example: Copy directories only</b>
-     * 
+     *
      * <pre>
      * // only copy the directory structure
      * FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY, false);
      * </pre>
      *
      * <b>Example: Copy directories and txt files</b>
-     * 
+     *
      * <pre>
      * // Create a filter for ".txt" files
      * IOFileFilter txtSuffixFilter = FileFilterUtils.suffixFileFilter(".txt");
@@ -624,14 +624,14 @@ public class FileUtils {
      * will succeed. If the modification operation fails, the methods throws IOException.
      * </p>
      * <b>Example: Copy directories only</b>
-     * 
+     *
      * <pre>
      * // only copy the directory structure
      * FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY, false);
      * </pre>
      *
      * <b>Example: Copy directories and txt files</b>
-     * 
+     *
      * <pre>
      * // Create a filter for ".txt" files
      * IOFileFilter txtSuffixFilter = FileFilterUtils.suffixFileFilter(".txt");
@@ -834,7 +834,7 @@ public class FileUtils {
 
     /**
      * Copies the given array and adds StandardCopyOption.COPY_ATTRIBUTES.
-     * 
+     *
      * @param copyOptions sorted copy options.
      * @return a new array.
      */
@@ -1437,7 +1437,7 @@ public class FileUtils {
 
     /**
      * Gets the parent of the given file. The given file may be bull and a file's parent may as well be null.
-     * 
+     *
      * @param file The file to query.
      * @return The parent file or {@code null}.
      */
@@ -1500,7 +1500,7 @@ public class FileUtils {
     public static boolean isEmptyDirectory(final File directory) throws IOException {
         return PathUtils.isEmptyDirectory(directory.toPath());
     }
-    
+
     /**
      * Tests if the specified {@code File} is newer than the specified {@code ChronoLocalDate}
      * at the current time.
@@ -1833,7 +1833,7 @@ public class FileUtils {
      * <p>
      * This method delegates to {@link Files#isSymbolicLink(Path path)}
      * </p>
-     * 
+     *
      * @param file the file to test.
      * @return true if the file is a symbolic link, see {@link Files#isSymbolicLink(Path path)}.
      * @since 2.0
@@ -2511,7 +2511,7 @@ public class FileUtils {
 
     /**
      * Throws IllegalArgumentException if the given files' canonical representations are equal.
-     * 
+     *
      * @param file1 The first file to compare.
      * @param file2 The second file to compare.
      * @throws IllegalArgumentException if the given files' canonical representations are equal.
@@ -2527,7 +2527,7 @@ public class FileUtils {
     /**
      * Throws an {@link IllegalArgumentException} if the file is not writable. This provides a more precise exception
      * message than a plain access denied.
-     * 
+     *
      * @param file The file to test.
      * @param name The parameter name to use in the exception message.
      * @throws NullPointerException if the given {@code File} is {@code null}.
@@ -2544,7 +2544,7 @@ public class FileUtils {
      * Requires that the given {@code File} is a directory.
      *
      * @param directory The {@code File} to check.
-     * @param name 
+     * @param name
      * @return the given directory.
      * @throws NullPointerException if the given {@code File} is {@code null}.
      * @throws IllegalArgumentException if the given {@code File} does not exist or is not a directory.
@@ -2959,7 +2959,7 @@ public class FileUtils {
     /**
      * Converts whether or not to recurse into a recursion max depth.
      *
-     * @param recursive whether or not to recurse 
+     * @param recursive whether or not to recurse
      * @return the recursion depth
      */
     private static int toMaxDepth(final boolean recursive) {
@@ -2993,7 +2993,7 @@ public class FileUtils {
      * </p>
      *
      * @param file the File to touch.
-     * @throws IOException if an I/O problem occurs. 
+     * @throws IOException if an I/O problem occurs.
      * @throws IOException if setting the last-modified time failed.
      */
     public static void touch(final File file) throws IOException {
@@ -3502,6 +3502,6 @@ public class FileUtils {
      */
     @Deprecated
     public FileUtils() { //NOSONAR
-        
+
     }
 }
diff --git a/src/main/java/org/apache/commons/io/FilenameUtils.java b/src/main/java/org/apache/commons/io/FilenameUtils.java
index 3145948..fccf46d 100644
--- a/src/main/java/org/apache/commons/io/FilenameUtils.java
+++ b/src/main/java/org/apache/commons/io/FilenameUtils.java
@@ -997,7 +997,7 @@ public class FilenameUtils {
      * Checks the input for null bytes, a sign of unsanitized data being passed to to file level functions.
      *
      * This may be used for poison byte attacks.
-     * 
+     *
      * @param path the path to check
      */
     private static void requireNonNullChars(final String path) {
diff --git a/src/main/java/org/apache/commons/io/IOUtils.java b/src/main/java/org/apache/commons/io/IOUtils.java
index bdfc561..ad16876 100644
--- a/src/main/java/org/apache/commons/io/IOUtils.java
+++ b/src/main/java/org/apache/commons/io/IOUtils.java
@@ -157,14 +157,14 @@ public class IOUtils {
 
     /**
      * The Unix line separator string.
-     * 
+     *
      * @see StandardLineSeparator#LF
      */
     public static final String LINE_SEPARATOR_UNIX = StandardLineSeparator.LF.getString();
 
     /**
      * The Windows line separator string.
-     * 
+     *
      * @see StandardLineSeparator#CRLF
      */
     public static final String LINE_SEPARATOR_WINDOWS = StandardLineSeparator.CRLF.getString();
@@ -1156,7 +1156,7 @@ public class IOUtils {
      * </p>
      *
      * @param inputStream the {@code InputStream} to read.
-     * @param outputStream the {@code OutputStream} to write. 
+     * @param outputStream the {@code OutputStream} to write.
      * @param buffer the buffer to use for the copy
      * @return the number of bytes copied.
      * @throws NullPointerException if the InputStream is {@code null}.
@@ -3385,7 +3385,7 @@ public class IOUtils {
      * Instances should NOT be constructed in standard programming.
      */
     public IOUtils() { //NOSONAR
-        
+
     }
 
 }
diff --git a/src/main/java/org/apache/commons/io/StreamIterator.java b/src/main/java/org/apache/commons/io/StreamIterator.java
index 6c27bc4..b5cc1c4 100644
--- a/src/main/java/org/apache/commons/io/StreamIterator.java
+++ b/src/main/java/org/apache/commons/io/StreamIterator.java
@@ -39,7 +39,7 @@ class StreamIterator<E> implements Iterator<E>, Closeable {
      * In order to close the stream, the call site MUST either close the stream it allocated OR call the iterator until
      * the end.
      * </p>
-     * 
+     *
      * @param <T> The stream and iterator type.
      * @param stream The stream iterate.
      * @return A new iterator.
diff --git a/src/main/java/org/apache/commons/io/file/CountingPathVisitor.java b/src/main/java/org/apache/commons/io/file/CountingPathVisitor.java
index c4b0ade..bfe2841 100644
--- a/src/main/java/org/apache/commons/io/file/CountingPathVisitor.java
+++ b/src/main/java/org/apache/commons/io/file/CountingPathVisitor.java
@@ -112,7 +112,7 @@ public class CountingPathVisitor extends SimplePathVisitor {
         updateDirCounter(dir, exc);
         return FileVisitResult.CONTINUE;
     }
-    
+
     @Override
     public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attributes) throws IOException {
         final FileVisitResult accept = dirFilter.accept(dir, attributes);
diff --git a/src/main/java/org/apache/commons/io/file/DirectoryStreamFilter.java b/src/main/java/org/apache/commons/io/file/DirectoryStreamFilter.java
index 029a125..d4c0b46 100644
--- a/src/main/java/org/apache/commons/io/file/DirectoryStreamFilter.java
+++ b/src/main/java/org/apache/commons/io/file/DirectoryStreamFilter.java
@@ -53,7 +53,7 @@ public class DirectoryStreamFilter implements DirectoryStream.Filter<Path> {
 
     /**
      * Gets the path filter.
-     * 
+     *
      * @return the path filter.
      */
     public PathFilter getPathFilter() {
diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java
index 0ac3e4f..809c708 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -155,7 +155,7 @@ public final class PathUtils {
 
     /**
      * {@link LinkOption} array for {@link LinkOption#NOFOLLOW_LINKS}.
-     * 
+     *
      * @since 2.9.0
      */
     public static final LinkOption[] NOFOLLOW_LINK_OPTION_ARRAY = new LinkOption[] {LinkOption.NOFOLLOW_LINKS};
@@ -292,7 +292,7 @@ public final class PathUtils {
     }
 
     /**
-     * Creates the parent directories for the given {@code path}. 
+     * Creates the parent directories for the given {@code path}.
      * <p>
      * Returns the {@code path}'s parent directory if it already exists.
      * </p>
@@ -313,7 +313,7 @@ public final class PathUtils {
         }
         return Files.createDirectories(parent, attrs);
     }
-    
+
     /**
      * Gets the current directory.
      *
diff --git a/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
index 879ca58..fa3b282 100644
--- a/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java
@@ -56,7 +56,7 @@ public class AndFileFilter
 
     /**
      * Constructs a new instance with the given initial list.
-     * 
+     *
      * @param initialList the initial list.
      */
     private AndFileFilter(final ArrayList<IOFileFilter> initialList) {
@@ -65,7 +65,7 @@ public class AndFileFilter
 
     /**
      * Constructs a new instance with the given initial capacity.
-     * 
+     *
      * @param initialCapacity the initial capacity.
      */
     private AndFileFilter(final int initialCapacity) {
diff --git a/src/main/java/org/apache/commons/io/filefilter/FalseFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/FalseFileFilter.java
index 46fdd5b..51545a1 100644
--- a/src/main/java/org/apache/commons/io/filefilter/FalseFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/FalseFileFilter.java
@@ -78,7 +78,7 @@ public class FalseFileFilter implements IOFileFilter, Serializable {
 
     /**
      * Returns false.
-     * 
+     *
      * @param file the file to check (ignored)
      *
      * @return false
diff --git a/src/main/java/org/apache/commons/io/filefilter/OrFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/OrFileFilter.java
index 572bdfe..7ac08f4 100644
--- a/src/main/java/org/apache/commons/io/filefilter/OrFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/OrFileFilter.java
@@ -52,7 +52,7 @@ public class OrFileFilter extends AbstractFileFilter implements ConditionalFileF
 
     /**
      * Constructs a new instance with the given initial list.
-     * 
+     *
      * @param initialList the initial list.
      */
     private OrFileFilter(final ArrayList<IOFileFilter> initialList) {
@@ -61,7 +61,7 @@ public class OrFileFilter extends AbstractFileFilter implements ConditionalFileF
 
     /**
      * Constructs a new instance with the given initial capacity.
-     * 
+     *
      * @param initialCapacity the initial capacity.
      */
     private OrFileFilter(final int initialCapacity) {
diff --git a/src/main/java/org/apache/commons/io/filefilter/PathEqualsFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/PathEqualsFileFilter.java
index fd50687..ccae991 100644
--- a/src/main/java/org/apache/commons/io/filefilter/PathEqualsFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/PathEqualsFileFilter.java
@@ -36,7 +36,7 @@ public class PathEqualsFileFilter extends AbstractFileFilter {
 
     /**
      * Constructs a new instance for the given {@link Path}.
-     * 
+     *
      * @param file The file to match.
      */
     public PathEqualsFileFilter(final Path file) {
diff --git a/src/main/java/org/apache/commons/io/filefilter/TrueFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/TrueFileFilter.java
index 7a4f335..a3fa9fd 100644
--- a/src/main/java/org/apache/commons/io/filefilter/TrueFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/TrueFileFilter.java
@@ -95,7 +95,7 @@ public class TrueFileFilter implements IOFileFilter, Serializable {
 
     @Override
     public IOFileFilter or(final IOFileFilter fileFilter) {
-        // TRUE OR expression <=> true 
+        // TRUE OR expression <=> true
         return INSTANCE;
     }
 
diff --git a/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java b/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java
index 9cfac02..a2c95f6 100644
--- a/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java
@@ -117,7 +117,7 @@ public final class BufferedFileChannelInputStream extends InputStream {
      * sun.misc.Cleaner.clean() to invoke it. The type changed to jdk.internal.ref.Cleaner in later JDKs, and the
      * .clean() method is not accessible even with reflection. However sun.misc.Unsafe added a invokeCleaner() method in
      * JDK 9+ and this is still accessible with reflection.
-     * 
+     *
      * @param buffer the buffer to clean.
      */
     private void clean(final DirectBuffer buffer) {
diff --git a/src/main/java/org/apache/commons/io/input/QueueInputStream.java b/src/main/java/org/apache/commons/io/input/QueueInputStream.java
index dc86414..bf589cb 100644
--- a/src/main/java/org/apache/commons/io/input/QueueInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/QueueInputStream.java
@@ -28,28 +28,28 @@ import java.util.concurrent.LinkedBlockingQueue;
 /**
  * Simple alternative to JDK {@link java.io.PipedInputStream}; queue input stream provides what's written in queue
  * output stream.
- * 
+ *
  * <p>
  * Example usage:
  * </p>
- * 
+ *
  * <pre>
  * QueueInputStream inputStream = new QueueInputStream();
  * QueueOutputStream outputStream = inputStream.newQueueOutputStream();
- * 
+ *
  * outputStream.write("hello world".getBytes(UTF_8));
  * inputStream.read();
  * </pre>
- * 
+ *
  * Unlike JDK {@link PipedInputStream} and {@link PipedOutputStream}, queue input/output streams may be used safely in a
  * single thread or multiple threads. Also, unlike JDK classes, no special meaning is attached to initial or current
  * thread. Instances can be used longer after initial threads exited.
- * 
+ *
  * <p>
  * Closing a {@code QueueInputStream} has no effect. The methods in this class can be called after the stream has been
  * closed without generating an {@code IOException}.
  * </p>
- * 
+ *
  * @see QueueOutputStream
  * @since 2.9.0
  */
@@ -66,7 +66,7 @@ public class QueueInputStream extends InputStream {
 
     /**
      * Constructs a new instance with given buffer
-     * 
+     *
      * @param blockingQueue backing queue for the stream
      */
     public QueueInputStream(final BlockingQueue<Integer> blockingQueue) {
@@ -76,7 +76,7 @@ public class QueueInputStream extends InputStream {
     /**
      * Creates a new QueueOutputStream instance connected to this. Writes to the output stream will be visible to this
      * input stream.
-     * 
+     *
      * @return QueueOutputStream connected to this stream
      */
     public QueueOutputStream newQueueOutputStream() {
diff --git a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
index ef1c58b..878af30 100644
--- a/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/ReadAheadInputStream.java
@@ -393,7 +393,7 @@ public class ReadAheadInputStream extends InputStream {
     /**
      * Internal skip function which should be called only from skip(). The assumption is that the stateChangeLock is
      * already acquired in the caller before calling this function.
-     * 
+     *
      * @param n the number of bytes to be skipped.
      * @return the actual number of bytes skipped.
      */
diff --git a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
index 56d223a..5c37baa 100644
--- a/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
+++ b/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
@@ -338,10 +338,10 @@ public class ReversedLinesFileReader implements Closeable {
 
         // NOTE: The new line sequences are matched in the order given, so it is
         // important that \r\n is BEFORE \n
-        this.newLineSequences = new byte[][] { 
-            StandardLineSeparator.CRLF.getBytes(this.charset), 
+        this.newLineSequences = new byte[][] {
+            StandardLineSeparator.CRLF.getBytes(this.charset),
             StandardLineSeparator.LF.getBytes(this.charset),
-            StandardLineSeparator.CR.getBytes(this.charset) 
+            StandardLineSeparator.CR.getBytes(this.charset)
         };
 
         this.avoidNewlineSplitBufferSize = newLineSequences[0].length;
diff --git a/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java b/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java
index 4d57f7d..d70ce92 100644
--- a/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java
@@ -46,7 +46,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Return <code>{@link #readByte()} != 0</code>
-     * 
+     *
      * @return false if the byte read is zero, otherwise true
      * @throws IOException if an I/O error occurs
      * @throws EOFException if an end of file is reached unexpectedly
@@ -58,7 +58,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Invokes the delegate's {@code read()} method.
-     * 
+     *
      * @return the byte read or -1 if the end of stream
      * @throws IOException if an I/O error occurs
      * @throws EOFException if an end of file is reached unexpectedly
@@ -70,7 +70,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Reads a character delegating to {@link #readShort()}.
-     * 
+     *
      * @return the byte read or -1 if the end of stream
      * @throws IOException if an I/O error occurs
      * @throws EOFException if an end of file is reached unexpectedly
@@ -82,7 +82,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedDouble(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws IOException if an I/O error occurs
      * @throws EOFException if an end of file is reached unexpectedly
@@ -94,7 +94,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedFloat(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws IOException if an I/O error occurs
      * @throws EOFException if an end of file is reached unexpectedly
@@ -143,7 +143,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedInteger(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -155,7 +155,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Not currently supported - throws {@link UnsupportedOperationException}.
-     * 
+     *
      * @return the line read
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -167,7 +167,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedLong(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -179,7 +179,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedShort(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -191,7 +191,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Invokes the delegate's {@code read()} method.
-     * 
+     *
      * @return the byte read or -1 if the end of stream
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -203,7 +203,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Delegates to {@link EndianUtils#readSwappedUnsignedShort(InputStream)}.
-     * 
+     *
      * @return the read long
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -215,7 +215,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Not currently supported - throws {@link UnsupportedOperationException}.
-     * 
+     *
      * @return UTF String read
      * @throws EOFException if an end of file is reached unexpectedly
      * @throws IOException if an I/O error occurs
@@ -227,7 +227,7 @@ public class SwappedDataInputStream extends ProxyInputStream implements DataInpu
 
     /**
      * Invokes the delegate's {@code skip(int)} method.
-     * 
+     *
      * @param count the number of bytes to skip
      * @return the number of bytes to skipped or -1 if the end of stream
      * @throws EOFException if an end of file is reached unexpectedly
diff --git a/src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java b/src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java
index 383a453..65a3221 100644
--- a/src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/buffer/CircularBufferInputStream.java
@@ -32,13 +32,13 @@ public class CircularBufferInputStream extends InputStream {
 
     /** What we are streaming, used to fill the internal buffer. */
     protected final InputStream in;
-    
+
     /** Internal buffer. */
     protected final CircularByteBuffer buffer;
 
     /** Internal buffer size. */
     protected final int bufferSize;
-    
+
     /** Whether we've see the input stream EOF. */
     private boolean eof;
 
diff --git a/src/main/java/org/apache/commons/io/output/QueueOutputStream.java b/src/main/java/org/apache/commons/io/output/QueueOutputStream.java
index 67e7c89..e1af097 100644
--- a/src/main/java/org/apache/commons/io/output/QueueOutputStream.java
+++ b/src/main/java/org/apache/commons/io/output/QueueOutputStream.java
@@ -32,15 +32,15 @@ import java.util.concurrent.LinkedBlockingQueue;
  * <p>
  * Example usage:
  * </p>
- * 
+ *
  * <pre>
  * QueueOutputStream outputStream = new QueueOutputStream();
  * QueueInputStream inputStream = outputStream.newPipeInputStream();
- * 
+ *
  * outputStream.write("hello world".getBytes(UTF_8));
  * inputStream.read();
  * </pre>
- * 
+ *
  * Unlike JDK {@link PipedInputStream} and {@link PipedOutputStream}, queue input/output streams may be used safely in a
  * single thread or multiple threads. Also, unlike JDK classes, no special meaning is attached to initial or current
  * thread. Instances can be used longer after initial threads exited.
@@ -48,7 +48,7 @@ import java.util.concurrent.LinkedBlockingQueue;
  * Closing a {@code QueueOutputStream} has no effect. The methods in this class can be called after the stream has been
  * closed without generating an {@code IOException}.
  * </p>
- * 
+ *
  * @see QueueInputStream
  * @since 2.9.0
  */
@@ -65,7 +65,7 @@ public class QueueOutputStream extends OutputStream {
 
     /**
      * Constructs a new instance with given buffer.
-     * 
+     *
      * @param blockingQueue backing queue for the stream
      */
     public QueueOutputStream(final BlockingQueue<Integer> blockingQueue) {
@@ -75,7 +75,7 @@ public class QueueOutputStream extends OutputStream {
     /**
      * Creates a new QueueInputStream instance connected to this. Writes to this output stream will be visible to the
      * input stream.
-     * 
+     *
      * @return QueueInputStream connected to this stream
      */
     public QueueInputStream newQueueInputStream() {
diff --git a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
index 2192e26..f7e1ba5 100644
--- a/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
+++ b/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
@@ -482,7 +482,7 @@ public class FileUtilsTestCase {
         assertSame(testChecksum, resultChecksum);
         assertEquals(expectedValue, resultValue);
     }
-    
+
     //-----------------------------------------------------------------------
     @Test
     public void testChecksumCRC32() throws Exception {
@@ -2182,7 +2182,7 @@ public class FileUtilsTestCase {
         assertTrue(destination.exists(), "Check Exist");
         assertTrue(!src.exists(), "Original deleted");
     }
-    
+
     @Test
     public void testMoveFile_CopyDelete_Failed() throws Exception {
         final File destination = new File(temporaryFolder, "move3.txt");
@@ -2208,13 +2208,13 @@ public class FileUtilsTestCase {
         assertTrue(!destination.exists(), "Check Rollback");
         assertTrue(src.exists(), "Original exists");
     }
-    
+
     @Test
     public void testMoveFile_CopyDelete_WithFileDatePreservation() throws Exception {
         final File destination = new File(temporaryFolder, "move2.txt");
-        
+
         backDateFile10Minutes(testFile1); // set test file back 10 minutes
-        
+
         final File src = new File(testFile1.getAbsolutePath()) {
             private static final long serialVersionUID = 1L;
 
@@ -2226,11 +2226,11 @@ public class FileUtilsTestCase {
             }
         };
         final long expected = getLastModifiedMillis(testFile1);
-        
+
         FileUtils.moveFile(src, destination, StandardCopyOption.COPY_ATTRIBUTES);
         assertTrue(destination.exists(), "Check Exist");
         assertTrue(!src.exists(), "Original deleted");
-        
+
         final long destLastMod = getLastModifiedMillis(destination);
         final long delta = destLastMod - expected;
         assertEquals(expected, destLastMod, "Check last modified date same as input, delta " + delta);
@@ -2239,12 +2239,12 @@ public class FileUtilsTestCase {
     @Test
     public void testMoveFile_CopyDelete_WithoutFileDatePreservation() throws Exception {
         final File destination = new File(temporaryFolder, "move2.txt");
-        
+
         backDateFile10Minutes(testFile1); // set test file back 10 minutes
-        
+
         // destination file time should not be less than this (allowing for granularity)
         final long now = System.currentTimeMillis() - 1000L;
-        
+
         final File src = new File(testFile1.getAbsolutePath()) {
             private static final long serialVersionUID = 1L;
 
@@ -2256,11 +2256,11 @@ public class FileUtilsTestCase {
             }
         };
         final long unexpected = getLastModifiedMillis(testFile1);
-        
+
         FileUtils.moveFile(src, destination, PathUtils.EMPTY_COPY_OPTIONS);
         assertTrue(destination.exists(), "Check Exist");
         assertTrue(!src.exists(), "Original deleted");
-        
+
         // On Windows, the last modified time is copied by default.
         if (!SystemUtils.IS_OS_WINDOWS) {
             final long destLastMod = getLastModifiedMillis(destination);
diff --git a/src/test/java/org/apache/commons/io/comparator/DefaultFileComparatorTest.java b/src/test/java/org/apache/commons/io/comparator/DefaultFileComparatorTest.java
index 48c44b2..73f4cc1 100644
--- a/src/test/java/org/apache/commons/io/comparator/DefaultFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/DefaultFileComparatorTest.java
@@ -26,7 +26,7 @@ import org.junit.jupiter.api.BeforeEach;
 public class DefaultFileComparatorTest extends ComparatorAbstractTestCase {
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         comparator = (AbstractFileComparator) DefaultFileComparator.DEFAULT_COMPARATOR;
         reverse = DefaultFileComparator.DEFAULT_REVERSE;
         equalFile1 = new File("foo");
diff --git a/src/test/java/org/apache/commons/io/comparator/DirectoryFileComparatorTest.java b/src/test/java/org/apache/commons/io/comparator/DirectoryFileComparatorTest.java
index cd5d13c..429fdc3 100644
--- a/src/test/java/org/apache/commons/io/comparator/DirectoryFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/DirectoryFileComparatorTest.java
@@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test;
 public class DirectoryFileComparatorTest extends ComparatorAbstractTestCase {
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         comparator = (AbstractFileComparator) DirectoryFileComparator.DIRECTORY_COMPARATOR;
         reverse = DirectoryFileComparator.DIRECTORY_REVERSE;
         final File currentDir = new File(".");
diff --git a/src/test/java/org/apache/commons/io/comparator/ExtensionFileComparatorTest.java b/src/test/java/org/apache/commons/io/comparator/ExtensionFileComparatorTest.java
index da2386e..af9df74 100644
--- a/src/test/java/org/apache/commons/io/comparator/ExtensionFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/ExtensionFileComparatorTest.java
@@ -31,7 +31,7 @@ public class ExtensionFileComparatorTest extends ComparatorAbstractTestCase {
 
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         comparator = (AbstractFileComparator) ExtensionFileComparator.EXTENSION_COMPARATOR;
         reverse = ExtensionFileComparator.EXTENSION_REVERSE;
         equalFile1 = new File("abc.foo");
diff --git a/src/test/java/org/apache/commons/io/comparator/NameFileComparatorTest.java b/src/test/java/org/apache/commons/io/comparator/NameFileComparatorTest.java
index 6b47575..fbd2fe8 100644
--- a/src/test/java/org/apache/commons/io/comparator/NameFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/NameFileComparatorTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.Test;
 public class NameFileComparatorTest extends ComparatorAbstractTestCase {
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         comparator = (AbstractFileComparator) NameFileComparator.NAME_INSENSITIVE_COMPARATOR;
         reverse = NameFileComparator.NAME_REVERSE;
         equalFile1 = new File("a/foo.txt");
diff --git a/src/test/java/org/apache/commons/io/comparator/PathFileComparatorTest.java b/src/test/java/org/apache/commons/io/comparator/PathFileComparatorTest.java
index 89283e3..b811689 100644
--- a/src/test/java/org/apache/commons/io/comparator/PathFileComparatorTest.java
+++ b/src/test/java/org/apache/commons/io/comparator/PathFileComparatorTest.java
@@ -31,7 +31,7 @@ public class PathFileComparatorTest extends ComparatorAbstractTestCase {
 
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         comparator = (AbstractFileComparator) PathFileComparator.PATH_COMPARATOR;
         reverse = PathFileComparator.PATH_REVERSE;
         equalFile1 = new File("foo/file.txt");
diff --git a/src/test/java/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java b/src/test/java/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java
index a5f82cb..98f929f 100644
--- a/src/test/java/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java
+++ b/src/test/java/org/apache/commons/io/filefilter/ConditionalFileFilterAbstractTestCase.java
@@ -38,7 +38,7 @@ public abstract class ConditionalFileFilterAbstractTestCase extends IOFileFilter
     private File workingPath;
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         this.workingPath = determineWorkingDirectoryPath(this.getWorkingPathNamePropertyKey(), this.getDefaultWorkingPath());
         this.file = new File(this.workingPath, TEST_FILE_NAME_PREFIX + 1 + TEST_FILE_TYPE);
         this.trueFilters = new TesterTrueFileFilter[4];
@@ -86,7 +86,7 @@ public abstract class ConditionalFileFilterAbstractTestCase extends IOFileFilter
     }
 
     @Test
-    public void testNoFilters() throws Exception {
+    public void testNoFilters() {
         final ConditionalFileFilter fileFilter = this.getConditionalFileFilter();
         final File file = new File(this.workingPath, TEST_FILE_NAME_PREFIX + 1 + TEST_FILE_TYPE);
         assertFileFiltering(1, (IOFileFilter) fileFilter, file, false);
@@ -94,7 +94,7 @@ public abstract class ConditionalFileFilterAbstractTestCase extends IOFileFilter
     }
 
     @Test
-    public void testFilterBuiltUsingConstructor() throws Exception {
+    public void testFilterBuiltUsingConstructor() {
         final List<List<IOFileFilter>> testFilters = this.getTestFilters();
         final List<boolean[]> testTrueResults = this.getTrueResults();
         final List<boolean[]> testFalseResults = this.getFalseResults();
@@ -128,7 +128,7 @@ public abstract class ConditionalFileFilterAbstractTestCase extends IOFileFilter
     }
 
     @Test
-    public void testFilterBuiltUsingAdd() throws Exception {
+    public void testFilterBuiltUsingAdd() {
         final List<List<IOFileFilter>> testFilters = this.getTestFilters();
         final List<boolean[]> testTrueResults = this.getTrueResults();
         final List<boolean[]> testFalseResults = this.getFalseResults();
diff --git a/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java b/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
index 4cc193d..b0d5dea 100644
--- a/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
+++ b/src/test/java/org/apache/commons/io/filefilter/IOFileFilterAbstractTestCase.java
@@ -22,21 +22,18 @@ import java.io.File;
 
 public abstract class IOFileFilterAbstractTestCase {
 
-    public static void assertFileFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
-            throws Exception {
+    public static void assertFileFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected) {
         assertEquals(expected, filter.accept(file),
                 "test " + testNumber + " Filter(File) " + filter.getClass().getName() + " not " + expected + " for " + file);
     }
 
-    public static void assertFilenameFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
-            throws Exception {
+    public static void assertFilenameFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected) {
         // Assumes file has parent and is not passed as null
         assertEquals(expected, filter.accept(file.getParentFile(), file.getName()),
                 "test " + testNumber + " Filter(File, String) " + filter.getClass().getName() + " not " + expected + " for " + file);
     }
 
-    public static void assertFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected)
-            throws Exception {
+    public static void assertFiltering(final int testNumber, final IOFileFilter filter, final File file, final boolean expected) {
         // Note. This only tests the (File, String) version if the parent of
         //       the File passed in is not null
         assertEquals(expected, filter.accept(file),
diff --git a/src/test/java/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java b/src/test/java/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
index b508c7a..12d2ea1 100644
--- a/src/test/java/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
+++ b/src/test/java/org/apache/commons/io/filefilter/RegexFileFilterTestCase.java
@@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test;
  */
 public class RegexFileFilterTestCase {
 
-    public void assertFiltering(final IOFileFilter filter, final File file, final boolean expected) throws Exception {
+    public void assertFiltering(final IOFileFilter filter, final File file, final boolean expected) {
         // Note. This only tests the (File, String) version if the parent of
         //       the File passed in is not null
         assertEquals(expected, filter.accept(file),
@@ -47,7 +47,7 @@ public class RegexFileFilterTestCase {
         }
     }
 
-    public void assertFiltering(final IOFileFilter filter, final Path path, final boolean expected) throws Exception {
+    public void assertFiltering(final IOFileFilter filter, final Path path, final boolean expected) {
         // Note. This only tests the (Path, Path) version if the parent of
         // the Path passed in is not null
         final FileVisitResult expectedFileVisitResult = AbstractFileFilter.toFileVisitResult(expected, path);
@@ -65,7 +65,7 @@ public class RegexFileFilterTestCase {
     }
 
     @Test
-    public void testRegex() throws Exception {
+    public void testRegex() {
         IOFileFilter filter = new RegexFileFilter("^.*[tT]est(-\\d+)?\\.java$");
         assertFiltering(filter, new File("Test.java"), true);
         assertFiltering(filter, new File("test-10.java"), true);
diff --git a/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java b/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
index eaef96e..93c6b26 100644
--- a/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/AbstractInputStreamTest.java
@@ -137,7 +137,7 @@ public abstract class AbstractInputStreamTest {
         final byte[] buf = new byte[1024];
         int read;
         while ((read = is.read(buf, 0, buf.length)) != -1) {
-            
+
         }
 
         final int readAfterEOF = is.read(buf, 0, buf.length);
diff --git a/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java b/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
index 8faaa65..d5fba7f 100644
--- a/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/BOMInputStreamTest.java
@@ -74,8 +74,7 @@ public class BOMInputStreamTest {
         }
     }
 
-    private void assertData(final byte[] expected, final byte[] actual, final int len)
-        throws Exception {
+    private void assertData(final byte[] expected, final byte[] actual, final int len) {
         assertEquals(expected.length, len, "length");
         for (int ii = 0; ii < expected.length; ii++) {
             assertEquals(expected[ii], actual[ii], "byte " + ii);
diff --git a/src/test/java/org/apache/commons/io/input/QueueInputStreamTest.java b/src/test/java/org/apache/commons/io/input/QueueInputStreamTest.java
index 774b985..6ed5eb9 100644
--- a/src/test/java/org/apache/commons/io/input/QueueInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/QueueInputStreamTest.java
@@ -41,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Test {@link QueueInputStream}.
- * 
+ *
  * @see {@link QueueOutputStreamTest}
  */
 public class QueueInputStreamTest {
diff --git a/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java b/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java
index f7f4dc8..5a74619 100644
--- a/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/RandomAccessFileInputStreamTest.java
@@ -74,7 +74,7 @@ public class RandomAccessFileInputStreamTest {
     }
 
     @Test
-    public void testCtorNullFile() throws FileNotFoundException {
+    public void testCtorNullFile() {
         assertThrows(NullPointerException.class, () -> new RandomAccessFileInputStream(null));
     }
 
diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java b/src/test/java/org/apache/commons/io/input/TailerTest.java
index 980b051..14176cd 100644
--- a/src/test/java/org/apache/commons/io/input/TailerTest.java
+++ b/src/test/java/org/apache/commons/io/input/TailerTest.java
@@ -63,7 +63,7 @@ public class TailerTest {
     private Tailer tailer;
 
     @AfterEach
-    public void tearDown() throws Exception {
+    public void tearDown() {
         if (tailer != null) {
             tailer.stop();
         }
diff --git a/src/test/java/org/apache/commons/io/input/TeeReaderTest.java b/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
index c01ac60..b697ca2 100644
--- a/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/TeeReaderTest.java
@@ -46,7 +46,7 @@ public class TeeReaderTest  {
     private Reader tee;
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         final Reader input = new CharSequenceReader("abc");
         output = new StringBuilderWriter();
         tee = new TeeReader(input, output);
@@ -123,7 +123,7 @@ public class TeeReaderTest  {
     }
 
     @Test
-    public void testReadNothing() throws Exception {
+    public void testReadNothing() {
         assertEquals("", output.toString());
     }
 
diff --git a/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java b/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java
index 327b723..61464c5 100644
--- a/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java
+++ b/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java
@@ -146,10 +146,9 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase {
 
     /**
      * Test checkAndNotify() creating
-     * @throws Exception
      */
     @Test
-    public void testFileCreate() throws Exception {
+    public void testFileCreate() {
         checkAndNotify();
         checkCollectionsEmpty("A");
         File testDirA = new File(testDir, "test-dir-A");
@@ -206,10 +205,9 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase {
 
     /**
      * Test checkAndNotify() creating
-     * @throws Exception
      */
     @Test
-    public void testFileUpdate() throws Exception {
+    public void testFileUpdate() {
         checkAndNotify();
         checkCollectionsEmpty("A");
         File testDirA = new File(testDir, "test-dir-A");
@@ -263,10 +261,9 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase {
 
     /**
      * Test checkAndNotify() deleting
-     * @throws Exception
      */
     @Test
-    public void testFileDelete() throws Exception {
+    public void testFileDelete() {
         checkAndNotify();
         checkCollectionsEmpty("A");
         File testDirA = new File(testDir, "test-dir-A");
@@ -323,10 +320,9 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase {
 
     /**
      * Test checkAndNotify() method
-     * @throws Exception
      */
     @Test
-    public void testObserveSingleFile() throws Exception {
+    public void testObserveSingleFile() {
         final File testDirA = new File(testDir, "test-dir-A");
         File testDirAFile1 = new File(testDirA, "A-file1.java");
         testDirA.mkdir();
@@ -376,10 +372,8 @@ public class FileAlterationObserverTestCase extends AbstractMonitorTestCase {
 
     /**
      * Call {@link FileAlterationObserver#checkAndNotify()}.
-     *
-     * @throws Exception if an error occurs
      */
-    protected void checkAndNotify() throws Exception {
+    protected void checkAndNotify() {
         observer.checkAndNotify();
     }
 }
diff --git a/src/test/java/org/apache/commons/io/output/AppendableOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/AppendableOutputStreamTest.java
index 69a3755..badfaf7 100644
--- a/src/test/java/org/apache/commons/io/output/AppendableOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/output/AppendableOutputStreamTest.java
@@ -30,7 +30,7 @@ public class AppendableOutputStreamTest {
     private AppendableOutputStream<StringBuilder> out;
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         out = new AppendableOutputStream<>(new StringBuilder());
     }
 
diff --git a/src/test/java/org/apache/commons/io/output/AppendableWriterTest.java b/src/test/java/org/apache/commons/io/output/AppendableWriterTest.java
index d521aa8..a502a82 100644
--- a/src/test/java/org/apache/commons/io/output/AppendableWriterTest.java
+++ b/src/test/java/org/apache/commons/io/output/AppendableWriterTest.java
@@ -30,7 +30,7 @@ public class AppendableWriterTest {
     private AppendableWriter<StringBuilder> out;
 
     @BeforeEach
-    public void setUp() throws Exception {
+    public void setUp() {
         out = new AppendableWriter<>(new StringBuilder());
     }
 
diff --git a/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java
index 41403a3..edab210 100644
--- a/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java
@@ -29,10 +29,9 @@ public class ClosedOutputStreamTest {
 
     /**
      * Test the {@code write(b)} method.
-     * @throws Exception
      */
     @Test
-    public void testWrite() throws Exception {
+    public void testWrite() {
         try (ClosedOutputStream cos = new ClosedOutputStream()) {
             cos.write('x');
             fail("write(b)");
@@ -43,10 +42,9 @@ public class ClosedOutputStreamTest {
 
     /**
      * Test the {@code flush()} method.
-     * @throws Exception
      */
     @Test
-    public void testFlush() throws Exception {
+    public void testFlush() {
         try (ClosedOutputStream cos = new ClosedOutputStream()) {
             cos.flush();
             fail("flush()");
diff --git a/src/test/java/org/apache/commons/io/output/ClosedWriterTest.java b/src/test/java/org/apache/commons/io/output/ClosedWriterTest.java
index 4f382c3..8677f36 100644
--- a/src/test/java/org/apache/commons/io/output/ClosedWriterTest.java
+++ b/src/test/java/org/apache/commons/io/output/ClosedWriterTest.java
@@ -29,10 +29,9 @@ public class ClosedWriterTest {
 
     /**
      * Test the {@code write(cbuf, off, len)} method.
-     * @throws Exception
      */
     @Test
-    public void testWrite() throws Exception {
+    public void testWrite() {
         try (ClosedWriter cw = new ClosedWriter()) {
             cw.write(new char[0], 0, 0);
             fail("write(cbuf, off, len)");
@@ -43,10 +42,9 @@ public class ClosedWriterTest {
 
     /**
      * Test the {@code flush()} method.
-     * @throws Exception
      */
     @Test
-    public void testFlush() throws Exception {
+    public void testFlush() {
         try (ClosedWriter cw = new ClosedWriter()) {
             cw.flush();
             fail("flush()");
diff --git a/src/test/java/org/apache/commons/io/output/QueueOutputStreamTest.java b/src/test/java/org/apache/commons/io/output/QueueOutputStreamTest.java
index 02c0179..d71724c 100644
--- a/src/test/java/org/apache/commons/io/output/QueueOutputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/output/QueueOutputStreamTest.java
@@ -38,7 +38,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
 
 /**
  * Test {@link QueueOutputStream} and {@link QueueInputStream}
- * 
+ *
  * @see QueueInputStreamTest
  */
 public class QueueOutputStreamTest {
diff --git a/src/test/java/org/apache/commons/io/serialization/FullClassNameMatcherTest.java b/src/test/java/org/apache/commons/io/serialization/FullClassNameMatcherTest.java
index 9971f7f..fce1be1 100644
--- a/src/test/java/org/apache/commons/io/serialization/FullClassNameMatcherTest.java
+++ b/src/test/java/org/apache/commons/io/serialization/FullClassNameMatcherTest.java
@@ -28,13 +28,13 @@ public class FullClassNameMatcherTest {
     private static final String [] NAMES_ARRAY = { Integer.class.getName(), Long.class.getName() };
 
     @Test
-    public void noNames() throws Exception {
+    public void noNames() {
         final FullClassNameMatcher m = new FullClassNameMatcher();
         assertFalse(m.matches(Integer.class.getName()));
     }
 
     @Test
-    public void withNames() throws Exception {
+    public void withNames() {
         final FullClassNameMatcher m = new FullClassNameMatcher(NAMES_ARRAY);
         assertTrue(m.matches(Integer.class.getName()));
         assertFalse(m.matches(String.class.getName()));
diff --git a/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java b/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java
index 8e48120..2b7cfe3 100644
--- a/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/serialization/ValidatingObjectInputStreamTest.java
@@ -199,7 +199,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase {
     }
 
     @Test
-    public void rejectOnly() throws Exception {
+    public void rejectOnly() {
         assertThrows(InvalidClassException.class,
                 () -> assertSerialization(
                 willClose(new ValidatingObjectInputStream(testStream))
@@ -208,7 +208,7 @@ public class ValidatingObjectInputStreamTest extends ClosingBase {
     }
 
     @Test
-    public void customInvalidMethod() throws Exception {
+    public void customInvalidMethod() {
         class CustomVOIS extends ValidatingObjectInputStream {
             CustomVOIS(final InputStream is) throws IOException {
                 super(is);