]> source.dussan.org Git - aspectj.git/commitdiff
guard on structure model dumping.
authoraclement <aclement>
Thu, 24 Mar 2005 11:01:37 +0000 (11:01 +0000)
committeraclement <aclement>
Thu, 24 Mar 2005 11:01:37 +0000 (11:01 +0000)
ajde/testsrc/org/aspectj/ajde/internal/AspectJBuildManagerTest.java
asm/src/org/aspectj/asm/AsmManager.java

index f94ff660ff36a5003252c52b4c7c8d3206bbde0c..108c17866284c36c35569cf0e1a2642b6192765a 100644 (file)
@@ -15,6 +15,8 @@ package org.aspectj.ajde.internal;
 
 import junit.framework.*;
 import org.aspectj.ajde.*;
+import org.aspectj.asm.AsmManager;
+
 import java.io.*;
 
 /**
@@ -33,6 +35,8 @@ public class AspectJBuildManagerTest extends AjdeTestCase {
        }
 
        public void testSequence() {
+               AsmManager.dumpModelPostBuild=true; // or you wont get a .ajsym file
+               try {
                assertTrue("initialization", ideManager != null);
         assertTrue("compile of non-existing build config success", !testerBuildListener.getBuildSucceeded());   
         // XXX should fail? empty configs fail b/c no sources specified
@@ -52,7 +56,10 @@ public class AspectJBuildManagerTest extends AjdeTestCase {
             file.delete();
         } else {
             assertTrue("expected .ajsym" + file, false);
-        }           
+        }    
+               } finally {
+                       AsmManager.dumpModelPostBuild=false;
+               }
        }
 
        protected void setUp() throws Exception {
index 9422d5f1ef4708f93fcf7b86794b6edf2ef8e04d..3c998c1d0beec32370378874a49b130f7f013c63 100644 (file)
@@ -41,6 +41,7 @@ public class AsmManager {
        private static boolean creatingModel = false;
        
 
+       public static boolean dumpModelPostBuild = false; // Dumping the model is expensive
        public static boolean attemptIncrementalModelRepairs = false;
 //     for debugging ...       
        
@@ -78,7 +79,7 @@ public class AsmManager {
 
        public void fireModelUpdated() {
                notifyListeners();      
-               if (hierarchy.getConfigFile() != null) {
+               if (dumpModelPostBuild && hierarchy.getConfigFile() != null) {
                        writeStructureModel(hierarchy.getConfigFile());
                }
        }