diff options
author | Andy Clement <aclement@gopivotal.com> | 2014-08-05 14:34:07 -0700 |
---|---|---|
committer | Andy Clement <aclement@gopivotal.com> | 2014-08-05 14:34:07 -0700 |
commit | dbcd8691f40e29a49f15465716e137d439d2268b (patch) | |
tree | 83420e36955f284af806a1c3812300153f21ac41 /util | |
parent | cd74697aa7273537f92414e8266b001699ccaa0a (diff) | |
download | aspectj-dbcd8691f40e29a49f15465716e137d439d2268b.tar.gz aspectj-dbcd8691f40e29a49f15465716e137d439d2268b.zip |
Tidy up post APT changes
Diffstat (limited to 'util')
-rw-r--r-- | util/src/org/aspectj/util/FileUtil.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/util/src/org/aspectj/util/FileUtil.java b/util/src/org/aspectj/util/FileUtil.java index 56b55042f..f3db2bda7 100644 --- a/util/src/org/aspectj/util/FileUtil.java +++ b/util/src/org/aspectj/util/FileUtil.java @@ -488,7 +488,8 @@ public class FileUtil { * @param dir the File directory (if a file, the the file is deleted) * @return the total number of files deleted */ - public static int deleteContents(File dir, FileFilter filter, boolean deleteEmptyDirs) { + public static int deleteContents(File dir, FileFilter filter, + boolean deleteEmptyDirs) { if (null == dir) { throw new IllegalArgumentException("null dir"); } @@ -499,28 +500,27 @@ public class FileUtil { dir.delete(); return 1; } - String[] fromFiles = dir.list(); - if (fromFiles == null) { - return 0; - } - int result = 0; - for (int i = 0; i < fromFiles.length; i++) { - String string = fromFiles[i]; - File file = new File(dir, string); - if ((null == filter) || filter.accept(file)) { - if (file.isDirectory()) { - result += deleteContents(file, filter, deleteEmptyDirs); - String[] fileContent = file.list(); - if (deleteEmptyDirs && - fileContent != null && - 0 == fileContent.length) { - file.delete(); - } - } else { - /* boolean ret = */ - file.delete(); - result++; - } + String[] fromFiles = dir.list(); + if (fromFiles == null) { + return 0; + } + int result = 0; + for (int i = 0; i < fromFiles.length; i++) { + String string = fromFiles[i]; + File file = new File(dir, string); + if ((null == filter) || filter.accept(file)) { + if (file.isDirectory()) { + result += deleteContents(file, filter, deleteEmptyDirs); + String[] fileContent = file.list(); + if (deleteEmptyDirs && fileContent != null + && 0 == fileContent.length) { + file.delete(); + } + } else { + /* boolean ret = */ + file.delete(); + result++; + } } } return result; |