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) {


Reply via email to