]> source.dussan.org Git - aspectj.git/commitdiff
provide a way to reset dump state to free up memory
authoracolyer <acolyer>
Fri, 10 Feb 2006 17:56:44 +0000 (17:56 +0000)
committeracolyer <acolyer>
Fri, 10 Feb 2006 17:56:44 +0000 (17:56 +0000)
weaver/src/org/aspectj/weaver/Dump.java

index ceeae047356de795c136afdb34a64497b3c3ccac..2d3c6c93f41985b131a15649110af2c1ab85d468 100644 (file)
@@ -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);
        }
+
 }