]> source.dussan.org Git - aspectj.git/commitdiff
231396: loop, dont iterate
authoraclement <aclement>
Thu, 19 Jun 2008 18:12:15 +0000 (18:12 +0000)
committeraclement <aclement>
Thu, 19 Jun 2008 18:12:15 +0000 (18:12 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java

index a2be79c82232db816608c9d17859f46ed898a1b0..01b575faa948de201c1c311d7daafef32d6b94c0 100644 (file)
@@ -2828,17 +2828,20 @@ class BcelClassWeaver implements IClassWeaver {
                return isMatched;
        } else {
                boolean isMatched = false;
-               for (Iterator i = shadowMungers.iterator(); i.hasNext(); ) {
-                   ShadowMunger munger = (ShadowMunger)i.next();
+               int max = shadowMungers.size();
+               for (int i=0;i<max;i++) {
+                       ShadowMunger munger = (ShadowMunger)shadowMungers.get(i);
                    if (munger.match(shadow, world)) {
                        shadow.addMunger(munger);
                        isMatched = true;
-                                   if (shadow.getKind() == Shadow.StaticInitialization) {
-                                         clazz.warnOnAddedStaticInitializer(shadow,munger.getSourceLocation());
-                                   }
+                       if (shadow.getKind() == Shadow.StaticInitialization) {
+                                         clazz.warnOnAddedStaticInitializer(shadow,munger.getSourceLocation());
+                               }       
                        }
                }               
-               if (isMatched) shadowAccumulator.add(shadow);
+               if (isMatched) {
+                       shadowAccumulator.add(shadow);
+               }
                return isMatched;
        }
     }