From 08fdf0bb14548f6ec39f118c84e939dde4092219 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 10 Mar 2005 17:22:08 +0000 Subject: [PATCH] Declare annotation: guard added for model building... (perf improvement!) --- asm/src/org/aspectj/asm/AsmManager.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/asm/src/org/aspectj/asm/AsmManager.java b/asm/src/org/aspectj/asm/AsmManager.java index 60645f3b0..9422d5f1e 100644 --- a/asm/src/org/aspectj/asm/AsmManager.java +++ b/asm/src/org/aspectj/asm/AsmManager.java @@ -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;} + } -- 2.39.5