aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2021-11-29 15:31:59 -0800
committerGitHub <noreply@github.com>2021-11-29 15:31:59 -0800
commit27aba3f4dfb18600f6b83e8cdf4e268d63d48ec0 (patch)
tree701f33ae353f92fa184e1484128e4843246cfc64 /testing
parent90cfa088f5a2c0c8eb2b04553e14c560f472512a (diff)
parent793a015abbdf77e20052362db626d9aea855c16b (diff)
downloadaspectj-27aba3f4dfb18600f6b83e8cdf4e268d63d48ec0.tar.gz
aspectj-27aba3f4dfb18600f6b83e8cdf4e268d63d48ec0.zip
Merge pull request #100 from turbanoff/File.exists_before_File.isDirectory_is_redundant
Remove redundant File.exists() check before File.isDirectory()
Diffstat (limited to 'testing')
-rw-r--r--testing/src/test/java/org/aspectj/testing/util/FileUtil.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
index 6aea81dfa..03b29a85a 100644
--- a/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
+++ b/testing/src/test/java/org/aspectj/testing/util/FileUtil.java
@@ -267,7 +267,7 @@ public class FileUtil {
* return true;
* }}, true);</code></pre>
* @param file root/starting point. If a file, the only one visited.
- * @param filter supplies boolean accept(File) method
+ * @param fileFilter supplies boolean accept(File) method
* @param userRecursion - if true, do accept() on dirs; else, recurse
* @return false if any fileFilter.accept(File) did.
* @throws IllegalArgumentException if file or fileFilter is null
@@ -655,7 +655,6 @@ public class FileUtil {
*/
protected static boolean deleteDirectory(File dir) {
return ((null != dir)
- && dir.exists()
&& dir.isDirectory()
&& FileUtil.descendFileTree(dir, DELETE_FILES, false)
&& FileUtil.descendFileTree(dir, DELETE_DIRS, true)
@@ -675,7 +674,7 @@ public class FileUtil {
protected static final FileFilter DELETE_DIRS = new FileFilter() {
public boolean accept(File file) {
return ((null != file) && file.isDirectory()
- && file.exists() && file.delete());
+ && file.delete());
}
};
protected static final FileFilter DELETE_FILES = new FileFilter() {