From: acolyer Date: Sat, 16 Aug 2003 19:29:42 +0000 (+0000) Subject: Added a removeAllListeners method to be called from test suite to X-Git-Tag: V1_1_1~81 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4468c138c94a858f26499deae0168562baf0c484;p=aspectj.git Added a removeAllListeners method to be called from test suite to prevent listener leakage which cripples performance of the test cases. --- diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java index fced532bc..d276fe569 100644 --- a/asm/src/org/aspectj/asm/AsmManager.java +++ b/asm/src/org/aspectj/asm/AsmManager.java @@ -119,6 +119,14 @@ public class AsmManager { structureListeners.remove(listener); } + // this shouldn't be needed - but none of the people that add listeners + // in the test suite ever remove them. AMC added this to be called in + // setup() so that the test cases would cease leaking listeners and go + // back to executing at a reasonable speed. + public void removeAllListeners() { + structureListeners.clear(); + } + private void notifyListeners() { for (Iterator it = structureListeners.iterator(); it.hasNext(); ) { ((IHierarchyListener)it.next()).elementsUpdated(hierarchy);