system/src/sc/layer/LayerTypeIndex.java
LayerTypeIndex refreshLayerTypeIndex(LayeredSystem sys, String layerName, long lastModified, RefreshTypeIndexContext refreshCtx, long startTime) {
      File layerFile = sys.getLayerFile(layerName);
      if (layerFile == null) {
         sys.warning("Layer found in type index - not in the layer path: " + layerName + ": " + sys.layerPathDirs);
         return null;
      }
      String pathName = layerFile.getParentFile().getPath();

      // Excluded in the project - do not refresh it
      if (sys.externalModelIndex != null && sys.externalModelIndex.isExcludedFile(pathName))
         return null;

      if (!pathName.equals(layerPathName)) {
         return sys.buildLayerTypeIndex(layerName, startTime);
      }

      /* We want to refresh the layers in layer order so that we set up the modify inheritance types properly */
      if (baseLayerNames != null) {
         for (String baseLayer:baseLayerNames) {
            sys.refreshLayerTypeIndexFile(baseLayer, refreshCtx, true, startTime);
         }
      }

      for (String srcDir:topLevelSrcDirs) {
         if (!Layer.isBuildDirPath(srcDir)) {
            File srcDirFile = new File(srcDir);

            if (!srcDirFile.isDirectory()) {
               sys.warning("srcDir removed for layer: " + layerName + ": " + srcDir + " rebuilding index");
               return sys.buildLayerTypeIndex(layerName, startTime);
            }

            sys.refreshLayerTypeIndexDir(srcDirFile, "", layerName, this, lastModified);
         }
         // else - TODO: do we need to handle this case?
      }
      return this;
   }
/**
    * Refresh the layer type index - look for files that exist on the file system that are not in the index and
    * files which have changed.  This is called on the main layered system since the peer system which owns this layer
    * may not have been created yet.  If we need to create the layer, be careful to use the layer's layeredSystem so
    * we get the one which is managing this index (since each type index is per-layered system).
    */
Refresh the layer type index - look for files that exist on the file system that are not in the index and
files which have changed.  This is called on the main layered system since the peer system which owns this layer
may not have been created yet.  If we need to create the layer, be careful to use the layer's layeredSystem so
we get the one which is managing this index (since each type index is per-layered system).
Refresh the layer type index - look for files that exist on the file system that are not in the index and files which have changed . This is called on the main layered system since the peer system which owns this layer may not have been created yet . If we need to create the layer be careful to use the layer ' s layeredSystem so we get the one which is managing this index ( since each type index is per - layered system ) .
LayerTypeIndex refreshLayerTypeIndex(LayeredSystem sys, String layerName, long lastModified, RefreshTypeIndexContext refreshCtx, long startTime) {
      File layerFile = sys.getLayerFile(layerName);
      if (layerFile == null) {
         sys.warning("Layer found in type index - not in the layer path: " + layerName + ": " + sys.layerPathDirs);
         return null;
      }
      String pathName = layerFile.getParentFile().getPath();
      if (sys.externalModelIndex != null && sys.externalModelIndex.isExcludedFile(pathName))
         return null;
      if (!pathName.equals(layerPathName)) {
         return sys.buildLayerTypeIndex(layerName, startTime);
      }
      /* We want to refresh the layers in layer order so that we set up the modify inheritance types properly */
      if (baseLayerNames != null) {
         for (String baseLayer:baseLayerNames) {
            sys.refreshLayerTypeIndexFile(baseLayer, refreshCtx, true, startTime);
         }
      }
      for (String srcDir:topLevelSrcDirs) {
         if (!Layer.isBuildDirPath(srcDir)) {
            File srcDirFile = new File(srcDir);
            if (!srcDirFile.isDirectory()) {
               sys.warning("srcDir removed for layer: " + layerName + ": " + srcDir + " rebuilding index");
               return sys.buildLayerTypeIndex(layerName, startTime);
            }
            sys.refreshLayerTypeIndexDir(srcDirFile, "", layerName, this, lastModified);
         }
      }
      return this;
   }
LayerTypeIndex refreshLayerTypeIndex ( LayeredSystem sys , String layerName , long lastModified , RefreshTypeIndexContext refreshCtx , long startTime ) { File layerFile = sys . getLayerFile ( layerName ) ; if ( layerFile == null ) { sys . warning ( "Layer found in type index - not in the layer path: " + layerName + ": " + sys . layerPathDirs ) ; return null ; } String pathName = layerFile . getParentFile ( ) . getPath ( ) ; if ( sys . externalModelIndex != null && sys . externalModelIndex . isExcludedFile ( pathName ) ) return null ; if ( ! pathName . equals ( layerPathName ) ) { return sys . buildLayerTypeIndex ( layerName , startTime ) ; } /* We want to refresh the layers in layer order so that we set up the modify inheritance types properly */ if ( baseLayerNames != null ) { for ( String baseLayer : baseLayerNames ) { sys . refreshLayerTypeIndexFile ( baseLayer , refreshCtx , true , startTime ) ; } } for ( String srcDir : topLevelSrcDirs ) { if ( ! Layer . isBuildDirPath ( srcDir ) ) { File srcDirFile = new File ( srcDir ) ; if ( ! srcDirFile . isDirectory ( ) ) { sys . warning ( "srcDir removed for layer: " + layerName + ": " + srcDir + " rebuilding index" ) ; return sys . buildLayerTypeIndex ( layerName , startTime ) ; } sys . refreshLayerTypeIndexDir ( srcDirFile , "" , layerName , this , lastModified ) ; } } return this ; }
Refresh the layer type index - look for files that exist on the file system that are not in the index and
 files which have changed.
Refresh the layer type index - look for files that exist on the file system that are not in the index and files which have changed .
// Excluded in the project - do not refresh it // else - TODO: do we need to handle this case?