ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r442772 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/DirectoryScanner.java
Date Wed, 13 Sep 2006 00:37:28 GMT
Author: antoine
Date: Tue Sep 12 17:37:27 2006
New Revision: 442772

URL: http://svn.apache.org/viewvc?view=rev&rev=442772
Log:
remove needless synchronization in DirectoryScanner. 
Bugzilla Report 40237. 

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=442772&r1=442771&r2=442772
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Tue Sep 12 17:37:27 2006
@@ -61,6 +61,9 @@
   location reflected into a method of the signature void setLocation(Location)
   - if such a method exists.
 
+* remove needless synchronization in DirectoryScanner.
+  Bugzilla report 40237.
+
 Changes from Ant 1.6.5 to Ant 1.7.0Beta1
 ========================================
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java?view=diff&rev=442772&r1=442771&r2=442772
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/DirectoryScanner.java Tue Sep 12 17:37:27
2006
@@ -20,23 +20,22 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.util.Map;
-import java.util.Set;
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Vector;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
 
 import org.apache.tools.ant.taskdefs.condition.Os;
 import org.apache.tools.ant.types.Resource;
 import org.apache.tools.ant.types.ResourceFactory;
+import org.apache.tools.ant.types.resources.FileResource;
 import org.apache.tools.ant.types.selectors.FileSelector;
-import org.apache.tools.ant.types.selectors.SelectorUtils;
 import org.apache.tools.ant.types.selectors.SelectorScanner;
-import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.selectors.SelectorUtils;
 import org.apache.tools.ant.util.FileUtils;
 
 /**
@@ -830,8 +829,8 @@
      * @since Ant 1.6
      */
     private void checkIncludePatterns() {
-        Hashtable newroots = new Hashtable();
-        // put in the newroots vector the include patterns without
+        Map newroots = new HashMap();
+        // put in the newroots map the include patterns without
         // wildcard tokens
         for (int i = 0; i < includes.length; i++) {
             if (FileUtils.isAbsolutePath(includes[i])) {
@@ -854,7 +853,7 @@
         } else {
             // only scan directories that can include matched files or
             // directories
-            Enumeration enum2 = newroots.keys();
+            Iterator it = newroots.entrySet().iterator();
 
             File canonBase = null;
             if (basedir != null) {
@@ -864,12 +863,13 @@
                     throw new BuildException(ex);
                 }
             }
-            while (enum2.hasMoreElements()) {
-                String currentelement = (String) enum2.nextElement();
+            while (it.hasNext()) {
+            	Map.Entry entry = (Map.Entry)it.next();
+                String currentelement = (String) entry.getKey();
                 if (basedir == null && !FileUtils.isAbsolutePath(currentelement))
{
                     continue;
                 }
-                String originalpattern = (String) newroots.get(currentelement);
+                String originalpattern = (String) entry.getValue();
                 File myfile = new File(basedir, currentelement);
 
                 if (myfile.exists()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message