From 4468c138c94a858f26499deae0168562baf0c484 Mon Sep 17 00:00:00 2001 From: acolyer Date: Sat, 16 Aug 2003 19:29:42 +0000 Subject: [PATCH] Added a removeAllListeners method to be called from test suite to prevent listener leakage which cripples performance of the test cases. --- asm/src/org/aspectj/asm/AsmManager.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.39.5