From 01e42ee873f5b20c54744f21748fe2d2f28c0744 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Wed, 22 Apr 2020 07:02:17 +0300 Subject: [PATCH] Eliminate some redundant checks --- pf4j/src/main/java/org/pf4j/util/FileUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pf4j/src/main/java/org/pf4j/util/FileUtils.java b/pf4j/src/main/java/org/pf4j/util/FileUtils.java index 092ef3b..2a0ca85 100644 --- a/pf4j/src/main/java/org/pf4j/util/FileUtils.java +++ b/pf4j/src/main/java/org/pf4j/util/FileUtils.java @@ -48,7 +48,7 @@ public class FileUtils { public static List readLines(Path path, boolean ignoreComments) throws IOException { File file = path.toFile(); - if (!file.exists() || !file.isFile()) { + if (!file.isFile()) { return new ArrayList<>(); } @@ -117,7 +117,7 @@ public class FileUtils { FileFilter jarFilter = new JarFileFilter(); FileFilter directoryFilter = new DirectoryFileFilter(); - if (Files.exists(folder) && Files.isDirectory(folder)) { + if (Files.isDirectory(folder)) { File[] jars = folder.toFile().listFiles(jarFilter); for (int i = 0; (jars != null) && (i < jars.length); ++i) { bucket.add(jars[i]); -- 2.39.5