From 7f01b5d12108c35313f1ba97391944ba751e935b Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 23 Jul 2003 07:57:07 +0000 Subject: [PATCH] Now that we avoid double scanning in scanDir, we don't need to perform parent-tests on the patterns anymore git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274899 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/DirectoryScanner.java | 31 +------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/main/org/apache/tools/ant/DirectoryScanner.java b/src/main/org/apache/tools/ant/DirectoryScanner.java index 4c761899e..f3628b6e1 100644 --- a/src/main/org/apache/tools/ant/DirectoryScanner.java +++ b/src/main/org/apache/tools/ant/DirectoryScanner.java @@ -672,36 +672,7 @@ public class DirectoryScanner for (int icounter = 0; icounter < includes.length; icounter++) { String newpattern = SelectorUtils.rtrimWildcardTokens(includes[icounter]); - // check whether the candidate new pattern has a parent - boolean hasParent = false; - Enumeration myenum = newroots.keys(); - // logically, there should be at most one child pattern present - // let's use a vector though to be sure - Vector vdelete = new Vector(); - while (myenum.hasMoreElements()) { - String existingpattern = (String) myenum.nextElement(); - // check whether the existing pattern is a child of the new pattern - if (existingpattern.length() >= newpattern.length()) { - if (existingpattern.indexOf(newpattern) == 0) { - vdelete.add(existingpattern); - } - } - // check whether the new pattern is a child of the existing pattern - if (existingpattern.length() <= newpattern.length()) { - if (newpattern.indexOf(existingpattern) == 0) { - hasParent = true; - break; - } - } - } - // add the new pattern if does not have parents - if (!hasParent) { - newroots.put(newpattern, includes[icounter]); - // remove child patterns - for (int icounter2 = 0; icounter2 < vdelete.size(); icounter2++) { - newroots.remove(vdelete.elementAt(icounter2)); - } - } + newroots.put(newpattern, includes[icounter]); } Enumeration enum2 = newroots.keys();