commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1088018 - /commons/proper/discovery/trunk/src/java/org/apache/commons/discovery/Resource.java
Date Sat, 02 Apr 2011 13:13:28 GMT
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;
     }



Mime
View raw message