From ce08d1423fd1526a36d36aacb7b30f4c6adc2647 Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 10 Feb 2006 17:56:44 +0000 Subject: [PATCH] provide a way to reset dump state to free up memory --- weaver/src/org/aspectj/weaver/Dump.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/weaver/src/org/aspectj/weaver/Dump.java b/weaver/src/org/aspectj/weaver/Dump.java index ceeae0473..2d3c6c93f 100644 --- a/weaver/src/org/aspectj/weaver/Dump.java +++ b/weaver/src/org/aspectj/weaver/Dump.java @@ -59,6 +59,28 @@ public class Dump { private static Map nodes = new HashMap(); private static String lastDumpFileName = UNKNOWN_FILENAME; + private static boolean preserveOnNextReset = false; + + /** + * for testing only, so that we can verify dump contents + * after compilation has completely finished + */ + public static void preserveOnNextReset() { + preserveOnNextReset = true; + } + + public static void reset() { + if (preserveOnNextReset) { + preserveOnNextReset = false; + return; + } + else { + Dump.nodes = new HashMap(); + Dump.savedMessageHolder = null; + } + } + + /* * Dump methods */ @@ -372,4 +394,5 @@ public class Dump { public void visitString (String s); public void visitList (List list); } + } -- 2.39.5