geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1654809 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
Date Mon, 26 Jan 2015 14:10:39 GMT
Author: rmannibucau
Date: Mon Jan 26 14:10:38 2015
New Revision: 1654809

URL: http://svn.apache.org/r1654809
Log:
XBEAN-277 recursivity = issues when we don't know jar sizes which is likely the case so removing
it

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

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java?rev=1654809&r1=1654808&r2=1654809&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/archive/JarArchive.java
Mon Jan 26 14:10:38 2015
@@ -98,29 +98,28 @@ public class JarArchive implements Archi
         }
 
         private boolean advance() {
-            if (next != null) return true;
-
-            if (!stream.hasMoreElements()) return false;
-
-            final JarEntry entry = stream.nextElement();
-            final String entryName = entry.getName();
-
-            if (entry.isDirectory() || !entryName.endsWith(".class")) {
-                return advance();
+            if (next != null) {
+                return true;
             }
+            while (stream.hasMoreElements()) {
+                final JarEntry entry = stream.nextElement();
+                final String entryName = entry.getName();
+                if (entry.isDirectory() || !entryName.endsWith(".class")) {
+                    continue;
+                }
+
+                String className = entryName;
+                if (entryName.endsWith(".class")) {
+                    className = className.substring(0, className.length() - 6);
+                }
+                if (className.contains(".")) {
+                    continue;
+                }
 
-            String className = entryName;
-            if (entryName.endsWith(".class")) {
-                className = className.substring(0, className.length() - 6);
+                next = new ClassEntry(entry, className.replace('/', '.'));
+                return true;
             }
-
-            if (className.contains(".")) {
-                return advance();
-            }
-
-            next = new ClassEntry(entry, className.replace('/', '.'));
-
-            return true;
+            return false;
         }
 
         public boolean hasNext() {



Mime
View raw message