]> source.dussan.org Git - aspectj.git/commitdiff
Declare annotation: guard added for model building... (perf improvement!)
authoraclement <aclement>
Thu, 10 Mar 2005 17:22:08 +0000 (17:22 +0000)
committeraclement <aclement>
Thu, 10 Mar 2005 17:22:08 +0000 (17:22 +0000)
asm/src/org/aspectj/asm/AsmManager.java

index 60645f3b09196959f49ff9c74af86e94e935d373..9422d5f1ef4708f93fcf7b86794b6edf2ef8e04d 100644 (file)
@@ -8,6 +8,7 @@
  *  
  * Contributors: 
  *     Mik Kersten     initial implementation 
+ *    Andy Clement     incremental support and switch on/off state
  * ******************************************************************/
 
 
@@ -37,6 +38,7 @@ public class AsmManager {
     protected IHierarchy hierarchy;
     private List structureListeners = new ArrayList();
        private IRelationshipMap mapper;
+       private static boolean creatingModel = false;
        
 
        public static boolean attemptIncrementalModelRepairs = false;
@@ -780,6 +782,21 @@ public class AsmManager {
                                                                 AsmManager.getDefault().getRelationshipMap());
                }
        }
+
+    /**
+     * Set to indicate whether we are currently building a structure model, should
+     * be set up front.
+     */
+       public static void setCreatingModel(boolean b) {
+               creatingModel = b;
+       }
+       
+    /**
+     * returns true if we are currently generating a structure model, enables
+     * guarding of expensive operations on an empty/null model.
+     */
+       public static boolean isCreatingModel() { return creatingModel;}
+       
        
 }