geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1638798 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java
Date Wed, 12 Nov 2014 14:16:29 GMT
Author: rmannibucau
Date: Wed Nov 12 14:16:29 2014
New Revision: 1638798

URL: http://svn.apache.org/r1638798
Log:
XBEAN-275 avoid useless loops

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java?rev=1638798&r1=1638797&r2=1638798&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassLoaders.java
Wed Nov 12 14:16:29 2014
@@ -51,20 +51,14 @@ public final class ClassLoaders {
                     }
                 }
             } else { // http://jira.codehaus.org/browse/SUREFIRE-928 - we could reuse findUrlFromResources
but this seems faster
-                for (final URL url : fromClassPath()) {
-                    urls.add(url);
-                }
+                urls.addAll(fromClassPath());
             }
+        }
 
-            // java -jar xxx.jar and use MANIFEST.MF Class-Path?
-            // here perf is not an issue since we would either miss all the classpath or
we have a single jar
-            if (urls.size() == 1) {
-                urls.addAll(findUrlFromResources(classLoader));
-            }
-        } else {
-            for (final URL url : findUrlFromResources(classLoader)) {
-                urls.add(url);
-            }
+        // DONT_USE_GET_URLS || java -jar xxx.jar and use MANIFEST.MF Class-Path?
+        // here perf is not an issue since we would either miss all the classpath or we have
a single jar
+        if (urls.size() <= 1) {
+            urls.addAll(findUrlFromResources(classLoader));
         }
 
         return urls;



Mime
View raw message