system/src/sc/lang/sc/ModifyDeclaration.java
protected void initDynamicType() {
      super.initDynamicType();

      boolean clearedDyn = false;
      if (dynamicType || dynamicNew) {
         if (modifyTypeDecl != null) {
            Layer modLayer = modifyTypeDecl.getLayer();
            LayeredSystem sys = modLayer.layeredSystem;
            String compiledClass;
            // If we are modifying a non-dynamic class which has already been loaded as a compiled class
            if (!modifyTypeDecl.isDynamicType() && modLayer.compiledInClassPath && sys.isClassLoaded(compiledClass = getCompiledClassName())) {
               dynamicType = false;
               dynamicNew = false;
               if (modifyNeedsClass())
                  sys.setStaleCompiledModel(true, "Modify of type: ", compiledClass, " already loaded as compiled type and needs to add definitions");

               clearedDyn = true;
            }
         }
         // NOTE: modifyTypeDecl is null here when called from initialize so this fails.  It gets reset in "start"
         if (!modifyNeedsClass() && !clearedDyn) {
            dynamicType = false;
            dynamicNew = true;
         }
      }
   }
/*
    * The initDynInstance handles all of the initialization
    *
   public void initDynInstance(Object inst, ExecutionContext ctx, boolean popCurrentObj) {
      // TODO: should avoid double initialization here by overridden fields
      if (modifyTypeDecl != null)
         modifyTypeDecl.initDynInstance(inst, ctx, popCurrentObj);
      super.initDynInstance(inst, ctx, popCurrentObj);
   }
   */
The initDynInstance handles all of the initialization
public void initDynInstance(Object inst, ExecutionContext ctx, boolean popCurrentObj) {
TODO: should avoid double initialization here by overridden fields
if (modifyTypeDecl != null)
modifyTypeDecl.initDynInstance(inst, ctx, popCurrentObj);
super.initDynInstance(inst, ctx, popCurrentObj);
}
The initDynInstance handles all of the initialization public void initDynInstance ( Object inst ExecutionContext ctx boolean popCurrentObj ) { TODO : should avoid double initialization here by overridden fields if ( modifyTypeDecl ! = null ) modifyTypeDecl . initDynInstance ( inst ctx popCurrentObj ) ; super . initDynInstance ( inst ctx popCurrentObj ) ; }
protected void initDynamicType() {
      super.initDynamicType();
      boolean clearedDyn = false;
      if (dynamicType || dynamicNew) {
         if (modifyTypeDecl != null) {
            Layer modLayer = modifyTypeDecl.getLayer();
            LayeredSystem sys = modLayer.layeredSystem;
            String compiledClass;
            if (!modifyTypeDecl.isDynamicType() && modLayer.compiledInClassPath && sys.isClassLoaded(compiledClass = getCompiledClassName())) {
               dynamicType = false;
               dynamicNew = false;
               if (modifyNeedsClass())
                  sys.setStaleCompiledModel(true, "Modify of type: ", compiledClass, " already loaded as compiled type and needs to add definitions");
               clearedDyn = true;
            }
         }
         if (!modifyNeedsClass() && !clearedDyn) {
            dynamicType = false;
            dynamicNew = true;
         }
      }
   }
protected void initDynamicType ( ) { super . initDynamicType ( ) ; boolean clearedDyn = false ; if ( dynamicType || dynamicNew ) { if ( modifyTypeDecl != null ) { Layer modLayer = modifyTypeDecl . getLayer ( ) ; LayeredSystem sys = modLayer . layeredSystem ; String compiledClass ; if ( ! modifyTypeDecl . isDynamicType ( ) && modLayer . compiledInClassPath && sys . isClassLoaded ( compiledClass = getCompiledClassName ( ) ) ) { dynamicType = false ; dynamicNew = false ; if ( modifyNeedsClass ( ) ) sys . setStaleCompiledModel ( true , "Modify of type: " , compiledClass , " already loaded as compiled type and needs to add definitions" ) ; clearedDyn = true ; } } if ( ! modifyNeedsClass ( ) && ! clearedDyn ) { dynamicType = false ; dynamicNew = true ; } } }
The initDynInstance handles all of the initialization
public void initDynInstance(Object inst, ExecutionContext ctx, boolean popCurrentObj) {
 TODO: should avoid double initialization here by overridden fields
if (modifyTypeDecl != null)
modifyTypeDecl.initDynInstance(inst, ctx, popCurrentObj);
super.initDynInstance(inst, ctx, popCurrentObj);
}
The initDynInstance handles all of the initialization public void initDynInstance ( Object inst ExecutionContext ctx boolean popCurrentObj ) { TODO : should avoid double initialization here by overridden fields if ( modifyTypeDecl ! = null ) modifyTypeDecl . initDynInstance ( inst ctx popCurrentObj ) ; super . initDynInstance ( inst ctx popCurrentObj ) ; }
// If we are modifying a non-dynamic class which has already been loaded as a compiled class // NOTE: modifyTypeDecl is null here when called from initialize so this fails.  It gets reset in "start"