You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/04/02 15:13:28 UTC

svn commit: r1088018 - /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java

Author: simonetripodi
Date: Sat Apr  2 13:13:28 2011
New Revision: 1088018

URL: http://svn.apache.org/viewvc?rev=1088018&view=rev
Log:
type-agnostic Vector replaced by typed LIst

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

Modified: commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java
URL: http://svn.apache.org/viewvc/commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java?rev=1088018&r1=1088017&r2=1088018&view=diff
==============================================================================
--- commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java (original)
+++ commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java Sat Apr  2 13:13:28 2011
@@ -19,7 +19,8 @@ package org.apache.commons.discovery;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
-import java.util.Vector;
+import java.util.LinkedList;
+import java.util.List;
 
 
 /**
@@ -102,12 +103,12 @@ public class Resource
     }
     
     public static Resource[] toArray(ResourceIterator iterator) {
-        Vector vector = new Vector();
+        List<Resource> resourceList = new LinkedList<Resource>();
         while (iterator.hasNext()) {
-            vector.add(iterator.nextResource());
+            resourceList.add(iterator.nextResource());
         }
-        Resource[] resources = new Resource[vector.size()];
-        vector.copyInto(resources);
+        Resource[] resources = new Resource[resourceList.size()];
+        resourceList.toArray(resources);
         
         return resources;
     }