From: aclement Date: Thu, 10 Mar 2005 17:22:08 +0000 (+0000) Subject: Declare annotation: guard added for model building... (perf improvement!) X-Git-Tag: V1_5_0M2~82 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=08fdf0bb14548f6ec39f118c84e939dde4092219;p=aspectj.git Declare annotation: guard added for model building... (perf improvement!) --- 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;} + }