commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1088112 - /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java
Date Sat, 02 Apr 2011 20:33:55 GMT
Author: simonetripodi
Date: Sat Apr  2 20:33:54 2011
New Revision: 1088112

URL: http://svn.apache.org/viewvc?rev=1088112&view=rev
Log:
agnostic Vector replaced by a typed List

Modified:
    commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java?rev=1088112&r1=1088111&r2=1088112&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java
(original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/ant/ServiceDiscoveryTask.java
Sat Apr  2 20:33:54 2011
@@ -16,7 +16,8 @@
  */
 package org.apache.commons.discovery.ant;
 
-import java.util.Vector;
+import java.util.LinkedList;
+import java.util.List;
 
 import org.apache.commons.discovery.ResourceNameIterator;
 import org.apache.commons.discovery.jdk.JDKHooks;
@@ -58,17 +59,17 @@ public class ServiceDiscoveryTask
         
         ResourceNameIterator iterator = disc.findResources(name);
 
-        Vector vector = new Vector();
+        List<String> resources = new LinkedList<String>();
         while (iterator.hasNext()) {
             String resourceInfo = iterator.nextResourceName();
-            vector.add(resourceInfo);
+            resources.add(resourceInfo);
             if( debug > 0 ) {
                 System.out.println("Found " + resourceInfo);
             }
         }
         
-        drivers = new String[vector.size()];
-        vector.copyInto(drivers);
+        drivers = new String[resources.size()];
+        resources.toArray(drivers);
     }
         
 }



Mime
View raw message