From 6a87b53fcb4f250a076f1447e45a173eb546c31c Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 10 Jun 2010 11:30:57 +0000 Subject: [PATCH] don't scan directories that are excluded recursively - this used to be done everywhere except for the (most common) case where the directory itself was not explicitly included. PR 49420 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@953281 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 6 ++++++ src/main/org/apache/tools/ant/DirectoryScanner.java | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index b3935d3e6..3b2f3a84d 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -45,6 +45,12 @@ Fixed bugs: a temporary file. Bugzilla Report 49419. + * Ant would often scan directories even though there were known to + only hold excluded files when evaluating filesets. This never + resulted in worng results but degraded performance of the scan + itself. + Bugzilla Report 49420. + Other changes: -------------- diff --git a/src/main/org/apache/tools/ant/DirectoryScanner.java b/src/main/org/apache/tools/ant/DirectoryScanner.java index ecd4e8726..7531954d4 100644 --- a/src/main/org/apache/tools/ant/DirectoryScanner.java +++ b/src/main/org/apache/tools/ant/DirectoryScanner.java @@ -1255,7 +1255,8 @@ public class DirectoryScanner } else { everythingIncluded = false; dirsNotIncluded.addElement(name); - if (fast && couldHoldIncluded(newPath)) { + if (fast && couldHoldIncluded(newPath) + && !contentsExcluded(newPath)) { scandir(file, newPath, fast, children, directoryNamesFollowed); }