aboutsummaryrefslogtreecommitdiffstats
path: root/testing/src
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2021-11-20 16:53:30 +0300
committerAndrey Turbanov <turbanoff@gmail.com>2021-11-20 16:53:30 +0300
commit793a015abbdf77e20052362db626d9aea855c16b (patch)
treefb01864e965e38f4f6f5c8fb0f78e4f5be4abef9 /testing/src
parent0f85ca109b9e6ab849e201e76f62d5023cbfcb98 (diff)
downloadaspectj-793a015abbdf77e20052362db626d9aea855c16b.tar.gz
aspectj-793a015abbdf77e20052362db626d9aea855c16b.zip
According to javadoc File.isDirectory 'true' if and only if the file denoted by this abstract pathname exists and is a directory.
It means that separate File.exists() check before File.isDirectory() check is redundant.
Diffstat (limited to 'testing/src')
-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() {