From: acolyer Date: Fri, 10 Feb 2006 17:56:44 +0000 (+0000) Subject: provide a way to reset dump state to free up memory X-Git-Tag: POST_MEMORY_CHANGES~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ce08d1423fd1526a36d36aacb7b30f4c6adc2647;p=aspectj.git provide a way to reset dump state to free up memory --- 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); } + }