You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/07/28 16:03:19 UTC

svn commit: r1836934 - /commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java

Author: ggregory
Date: Sat Jul 28 16:03:19 2018
New Revision: 1836934

URL: http://svn.apache.org/viewvc?rev=1836934&view=rev
Log:
[BCEL-305] ClassPath.getClassFile() and friends do not work with JRE 9 and higher. don't use a for each loop to avoid creating an iterator for the GC to collect.

Modified:
    commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java

Modified: commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java
URL: http://svn.apache.org/viewvc/commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java?rev=1836934&r1=1836933&r2=1836934&view=diff
==============================================================================
--- commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java (original)
+++ commons/proper/bcel/trunk/src/main/java/org/apache/bcel/util/ClassPath.java Sat Jul 28 16:03:19 2018
@@ -391,8 +391,9 @@ public class ClassPath implements Closea
         @Override
         public void close() throws IOException {
             if (modules != null) {
-                for (final JrtModule module : modules) {
-                    module.close();
+                // don't use a for each loop to avoid creating an iterator for the GC to collect.
+                for (int i = 0; i < modules.length; i++) {
+                    modules[i].close();
                 }
             }
             if (classLoader != null) {