commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1204262 - /commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java
Date Sun, 20 Nov 2011 21:00:44 GMT
Author: simonetripodi
Date: Sun Nov 20 21:00:44 2011
New Revision: 1204262

URL: http://svn.apache.org/viewvc?rev=1204262&view=rev
Log:
improved performances with fixed size arrays

Modified:
    commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java

Modified: commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java?rev=1204262&r1=1204261&r2=1204262&view=diff
==============================================================================
--- commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java
(original)
+++ commons/sandbox/meiyo/trunk/src/main/java/org/apache/commons/meiyo/classpath/ErrorHandlerBuilder.java
Sun Nov 20 21:00:44 2011
@@ -22,9 +22,7 @@ package org.apache.commons.meiyo.classpa
 import static java.lang.Runtime.getRuntime;
 import static java.util.concurrent.Executors.newFixedThreadPool;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 
@@ -68,11 +66,11 @@ public final class ErrorHandlerBuilder
         }
 
         ExecutorService executor = newFixedThreadPool( getRuntime().availableProcessors()
);
-        List<Future<?>> futures = new ArrayList<Future<?>>();
+        Future<?>[] futures = new Future<?>[paths.length];
 
-        for ( String path : paths )
+        for ( int i = 0; i < paths.length; i++ )
         {
-            futures.add( executor.submit( new PathAnalyzer( path, handlers, classLoader,
errorHandler ) ) );
+            futures[i] = executor.submit( new PathAnalyzer( paths[i], handlers, classLoader,
errorHandler ) );
         }
 
         for ( Future<?> future : futures )



Mime
View raw message