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-vfs.git
commit 053478c245ae0f436467ca9789901121fc979b9c Author: Gary Gregory <[email protected]> AuthorDate: Fri Nov 15 11:55:34 2024 -0500 It is OK to call java.io.File.listFiles(FileFilter) with a null argument - See the Javadoc - Remove extra whitespace --- .../java/org/apache/commons/vfs2/filter/BaseFilterTest.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/BaseFilterTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/BaseFilterTest.java index 9053728b..28a02a2e 100644 --- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/BaseFilterTest.java +++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/BaseFilterTest.java @@ -196,14 +196,7 @@ public abstract class BaseFilterTest { * @return List of child entries of the directory. */ private static File[] listFiles(final File srcDir, final FileFilter filter) { - - final File[] files; - if (filter == null) { - files = srcDir.listFiles(); - } else { - files = srcDir.listFiles(filter); - } - return files; + return srcDir.listFiles(filter); } /** @@ -222,7 +215,6 @@ public abstract class BaseFilterTest { */ public static void zipDir(final File srcDir, final FileFilter filter, final String destPath, final File destFile) throws IOException { - if (srcDir == null) { throw new IllegalArgumentException("srcDir cannot be null"); } @@ -235,7 +227,6 @@ public abstract class BaseFilterTest { if (destFile == null) { throw new IllegalArgumentException("destFile cannot be null"); } - try (ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(Files.newOutputStream(destFile.toPath())))) { zipDir(srcDir, filter, destPath, out); }
