]> source.dussan.org Git - aspectj.git/commitdiff
231396: Comment #4: Big Refactoring: tidyup loose joinpointsig iterators
authoraclement <aclement>
Thu, 29 May 2008 19:04:26 +0000 (19:04 +0000)
committeraclement <aclement>
Thu, 29 May 2008 19:04:26 +0000 (19:04 +0000)
weaver/src/org/aspectj/weaver/bcel/BcelClassWeaver.java

index 44f5388a090b3cb5100b418c78fc8ddf673b6bf7..f05f5b3cbb61e6599fed799e803c6dd72fd53367 100644 (file)
@@ -27,8 +27,8 @@ import java.util.Properties;
 import java.util.Set;
 
 import org.aspectj.apache.bcel.Constants;
-import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.apache.bcel.classfile.ConstantPool;
+import org.aspectj.apache.bcel.classfile.Method;
 import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen;
 import org.aspectj.apache.bcel.generic.FieldGen;
 import org.aspectj.apache.bcel.generic.FieldInstruction;
@@ -535,6 +535,13 @@ class BcelClassWeaver implements IClassWeaver {
         } else {
                clazz.getOrCreateWeaverStateInfo(false).setReweavable(false);
         }
+
+        // tidyup, reduce ongoing memory usage of BcelMethods that hang around
+        for (Iterator i = methodGens.iterator(); i.hasNext();) {
+            LazyMethodGen mg = (LazyMethodGen) i.next();
+            BcelMethod bM = mg.getMemberView();
+            if (bM != null) bM.wipeJoinpointSignatures();
+        }
         
         return isChanged;
     }