modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 127ba9e50f4a75d67cf021d0f688c2a064dc3824 Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Nov 29 09:04:50 2011 -0500
Make forEachFile() more efficient.
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java b/modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java index c4ac737..14ed3af 100644 --- a/modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java +++ b/modules/core/util/src/main/java/org/rhq/core/util/file/FileUtil.java @@ -353,8 +353,9 @@ public class FileUtil {
while (!directories.isEmpty()) { File dir = directories.pop(); - if (dir.listFiles()!=null) { - for (File file : dir.listFiles()) { + File[] files = dir.listFiles(); + if (files != null) { + for (File file : files) { if (file.isDirectory()) { directories.push(file); } else {
rhq-commits@lists.fedorahosted.org