system/src/sc/lang/java/TypeDeclaration.java
public boolean changedSinceLayer(Layer sinceLayer, Layer genLayer, boolean resolve, IdentityHashSet<TypeDeclaration> visited, Set<String> changedTypes, boolean processJava) {
      if (visited == null)
         visited = new IdentityHashSet<TypeDeclaration>();
      else if (visited.contains(this))
         return false;

      visited.add(this);

      // Get the most specific version of this type - i.e. walk up the modified food-chain.
      TypeDeclaration td = resolve ? (TypeDeclaration) resolve(true) : this;

      String fullTypeName = td.getFullTypeName();
      Layer typeLayer = td.getLayer();

      if (changedTypes == null || changedTypes.contains(fullTypeName)) {
         if (typeLayer == null)
            return true;
         // If it's an annotation layer, we don't generate anything for it so don't consider
         if (sinceLayer == null) {
            boolean fixedModel = false;
            // If the type layer is already compiled and final - e.g. sys.sccore the model is not changed even if sinceLayer == null but not for JS where we process Java files
            if (typeLayer.finalLayer && typeLayer.compiled && !processJava)
               fixedModel = true;

            // We do not have to consider annotation layers as changed at least in terms of dependent files.  They are not transformed anyway so will never have a "sinceLayer" that's not null
            if (typeLayer.annotationLayer)
               fixedModel = true;

            // Unless it's a special case model (i.e. one that's fixed in this case) if it has not been transformed yet, it's changed
            if (!fixedModel)
               return true;
         }
         if (sinceLayer != null) {
            if (genLayer == null || typeLayer.getLayerPosition() > sinceLayer.getLayerPosition())
               return true;
         }
      }

      Layer fromLayer = genLayer.getNextLayer();

      // For the root type, see if it's been modified by another file in between the layer we are building now to the layer where it
      // was initialized.  If so, we need to stop it before we do the build.
      if (getEnclosingType() == null) {
         LayeredSystem sys = getLayeredSystem();
         JavaModel model = getJavaModel();
         SrcEntry srcEnt = sys.getSrcFileFromTypeName(fullTypeName, true, fromLayer, model.getPrependPackage(), null, typeLayer, false);
         if (srcEnt != null) {
            Layer srcLayer = srcEnt.layer;
            // Is there a src file included in this build which is after the layer where we last initialized the type.  If so we need to
            // restart it on this build.
            if (sinceLayer != null && srcLayer != null && srcLayer.getLayerPosition() > sinceLayer.getLayerPosition())
               return true;
         }
      }

      Object extTD = td.getExtendsTypeDeclaration();
      if (extTD instanceof TypeDeclaration && ((TypeDeclaration)extTD).changedSinceLayer(sinceLayer, genLayer, true, visited, changedTypes, processJava))
         return true;

      Object derivedTD = td.getDerivedTypeDeclaration();
      if (derivedTD != extTD)
         if (derivedTD instanceof TypeDeclaration && ((TypeDeclaration)derivedTD).changedSinceLayer(sinceLayer, genLayer, false, visited, changedTypes, processJava))
            return true;

      if (bodyChangedSinceLayer(body, sinceLayer, genLayer, visited, changedTypes, processJava) || bodyChangedSinceLayer(hiddenBody, sinceLayer, genLayer, visited, changedTypes, processJava))
         return true;
      return false;
   }
// changed files in the dependency chain after the sinceLayer are considered.
changed files in the dependency chain after the sinceLayer are considered.
changed files in the dependency chain after the sinceLayer are considered .
public boolean changedSinceLayer(Layer sinceLayer, Layer genLayer, boolean resolve, IdentityHashSet<TypeDeclaration> visited, Set<String> changedTypes, boolean processJava) {
      if (visited == null)
         visited = new IdentityHashSet<TypeDeclaration>();
      else if (visited.contains(this))
         return false;
      visited.add(this);
      TypeDeclaration td = resolve ? (TypeDeclaration) resolve(true) : this;
      String fullTypeName = td.getFullTypeName();
      Layer typeLayer = td.getLayer();
      if (changedTypes == null || changedTypes.contains(fullTypeName)) {
         if (typeLayer == null)
            return true;
         if (sinceLayer == null) {
            boolean fixedModel = false;
            if (typeLayer.finalLayer && typeLayer.compiled && !processJava)
               fixedModel = true;
            if (typeLayer.annotationLayer)
               fixedModel = true;
            if (!fixedModel)
               return true;
         }
         if (sinceLayer != null) {
            if (genLayer == null || typeLayer.getLayerPosition() > sinceLayer.getLayerPosition())
               return true;
         }
      }
      Layer fromLayer = genLayer.getNextLayer();
      if (getEnclosingType() == null) {
         LayeredSystem sys = getLayeredSystem();
         JavaModel model = getJavaModel();
         SrcEntry srcEnt = sys.getSrcFileFromTypeName(fullTypeName, true, fromLayer, model.getPrependPackage(), null, typeLayer, false);
         if (srcEnt != null) {
            Layer srcLayer = srcEnt.layer;
            if (sinceLayer != null && srcLayer != null && srcLayer.getLayerPosition() > sinceLayer.getLayerPosition())
               return true;
         }
      }
      Object extTD = td.getExtendsTypeDeclaration();
      if (extTD instanceof TypeDeclaration && ((TypeDeclaration)extTD).changedSinceLayer(sinceLayer, genLayer, true, visited, changedTypes, processJava))
         return true;
      Object derivedTD = td.getDerivedTypeDeclaration();
      if (derivedTD != extTD)
         if (derivedTD instanceof TypeDeclaration && ((TypeDeclaration)derivedTD).changedSinceLayer(sinceLayer, genLayer, false, visited, changedTypes, processJava))
            return true;
      if (bodyChangedSinceLayer(body, sinceLayer, genLayer, visited, changedTypes, processJava) || bodyChangedSinceLayer(hiddenBody, sinceLayer, genLayer, visited, changedTypes, processJava))
         return true;
      return false;
   }
public boolean changedSinceLayer ( Layer sinceLayer , Layer genLayer , boolean resolve , IdentityHashSet < TypeDeclaration > visited , Set < String > changedTypes , boolean processJava ) { if ( visited == null ) visited = new IdentityHashSet < TypeDeclaration > ( ) ; else if ( visited . contains ( this ) ) return false ; visited . add ( this ) ; TypeDeclaration td = resolve ? ( TypeDeclaration ) resolve ( true ) : this ; String fullTypeName = td . getFullTypeName ( ) ; Layer typeLayer = td . getLayer ( ) ; if ( changedTypes == null || changedTypes . contains ( fullTypeName ) ) { if ( typeLayer == null ) return true ; if ( sinceLayer == null ) { boolean fixedModel = false ; if ( typeLayer . finalLayer && typeLayer . compiled && ! processJava ) fixedModel = true ; if ( typeLayer . annotationLayer ) fixedModel = true ; if ( ! fixedModel ) return true ; } if ( sinceLayer != null ) { if ( genLayer == null || typeLayer . getLayerPosition ( ) > sinceLayer . getLayerPosition ( ) ) return true ; } } Layer fromLayer = genLayer . getNextLayer ( ) ; if ( getEnclosingType ( ) == null ) { LayeredSystem sys = getLayeredSystem ( ) ; JavaModel model = getJavaModel ( ) ; SrcEntry srcEnt = sys . getSrcFileFromTypeName ( fullTypeName , true , fromLayer , model . getPrependPackage ( ) , null , typeLayer , false ) ; if ( srcEnt != null ) { Layer srcLayer = srcEnt . layer ; if ( sinceLayer != null && srcLayer != null && srcLayer . getLayerPosition ( ) > sinceLayer . getLayerPosition ( ) ) return true ; } } Object extTD = td . getExtendsTypeDeclaration ( ) ; if ( extTD instanceof TypeDeclaration && ( ( TypeDeclaration ) extTD ) . changedSinceLayer ( sinceLayer , genLayer , true , visited , changedTypes , processJava ) ) return true ; Object derivedTD = td . getDerivedTypeDeclaration ( ) ; if ( derivedTD != extTD ) if ( derivedTD instanceof TypeDeclaration && ( ( TypeDeclaration ) derivedTD ) . changedSinceLayer ( sinceLayer , genLayer , false , visited , changedTypes , processJava ) ) return true ; if ( bodyChangedSinceLayer ( body , sinceLayer , genLayer , visited , changedTypes , processJava ) || bodyChangedSinceLayer ( hiddenBody , sinceLayer , genLayer , visited , changedTypes , processJava ) ) return true ; return false ; }
changed files in the dependency chain after the sinceLayer are considered.
changed files in the dependency chain after the sinceLayer are considered .
// Get the most specific version of this type - i.e. walk up the modified food-chain. // If it's an annotation layer, we don't generate anything for it so don't consider // If the type layer is already compiled and final - e.g. sys.sccore the model is not changed even if sinceLayer == null but not for JS where we process Java files // We do not have to consider annotation layers as changed at least in terms of dependent files.  They are not transformed anyway so will never have a "sinceLayer" that's not null // Unless it's a special case model (i.e. one that's fixed in this case) if it has not been transformed yet, it's changed // For the root type, see if it's been modified by another file in between the layer we are building now to the layer where it // was initialized.  If so, we need to stop it before we do the build. // Is there a src file included in this build which is after the layer where we last initialized the type.  If so we need to // restart it on this build.