From: Decebal Suiu Date: Wed, 22 Apr 2020 04:02:17 +0000 (+0300) Subject: Eliminate some redundant checks X-Git-Tag: release-3.4.0~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=01e42ee873f5b20c54744f21748fe2d2f28c0744;p=pf4j.git Eliminate some redundant checks --- 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]);