system/src/sc/layer/Layer.java
public void addSrcFileIndex(String relFileName, byte[] hash, String ext, String absFileName) {
      if (!activated)
         throw new UnsupportedOperationException();
      for (int i = layerPosition; i < layeredSystem.layers.size(); i++) {
         Layer l = layeredSystem.layers.get(i);
         if (l.isBuildLayer()) {
            SrcIndexEntry sie = null;
            // Layer may not have been started yet - if we are building one layer to produce classes needed to
            // start the next layer
            if (l.buildSrcIndex == null)
               l.buildSrcIndex = l.readBuildSrcIndex();
            else {
               sie = l.buildSrcIndex.get(relFileName);
               if (sie != null) {
                  if (Arrays.equals(hash, sie.hash)) {
                     sie.inUse = true;
                     continue;
                  }
                  else {
                     if (layeredSystem.options.verboseLayerTypes && SrcIndexEntry.debugSrcIndexEntry) {
                        System.out.println("*** Adding mismatching entry in the same build layer?");
                        String oldVersion = new String(sie.fileBytes);
                        String newVersion = FileUtil.getFileAsString(absFileName);
                     }
                  }
               }
            }
            if (sie == null)
               sie = new SrcIndexEntry();
            sie.hash = hash;
            sie.inUse = true;
            sie.extension = ext;
            sie.layerName = getLayerName();
            sie.srcIndexLayer = l;

            if (SrcIndexEntry.debugSrcIndexEntry) {
               sie.updateDebugFileInfo(absFileName);
               if (sie.fileBytes == null)
                  System.err.println("*** No data for index entry for: " + absFileName);
               else if (!Arrays.equals(hash, StringUtil.computeHash(sie.fileBytes)))
                  System.err.println("*** internal error - hashes of file do no match from the start!");
            }

            if (traceBuildSrcIndex)
               System.out.println("Adding buildSrcIndex " + relFileName + " : " + sie + " runtime: " + layeredSystem.getRuntimeName());

            l.buildSrcIndex.put(relFileName, sie);

            buildSrcIndexNeedsSave = true;
         }
      }
   }
/** Register the source file in any build layers including or following this one */
Register the source file in any build layers including or following this one
Register the source file in any build layers including or following this one
public void addSrcFileIndex(String relFileName, byte[] hash, String ext, String absFileName) {
      if (!activated)
         throw new UnsupportedOperationException();
      for (int i = layerPosition; i < layeredSystem.layers.size(); i++) {
         Layer l = layeredSystem.layers.get(i);
         if (l.isBuildLayer()) {
            SrcIndexEntry sie = null;
            if (l.buildSrcIndex == null)
               l.buildSrcIndex = l.readBuildSrcIndex();
            else {
               sie = l.buildSrcIndex.get(relFileName);
               if (sie != null) {
                  if (Arrays.equals(hash, sie.hash)) {
                     sie.inUse = true;
                     continue;
                  }
                  else {
                     if (layeredSystem.options.verboseLayerTypes && SrcIndexEntry.debugSrcIndexEntry) {
                        System.out.println("*** Adding mismatching entry in the same build layer?");
                        String oldVersion = new String(sie.fileBytes);
                        String newVersion = FileUtil.getFileAsString(absFileName);
                     }
                  }
               }
            }
            if (sie == null)
               sie = new SrcIndexEntry();
            sie.hash = hash;
            sie.inUse = true;
            sie.extension = ext;
            sie.layerName = getLayerName();
            sie.srcIndexLayer = l;
            if (SrcIndexEntry.debugSrcIndexEntry) {
               sie.updateDebugFileInfo(absFileName);
               if (sie.fileBytes == null)
                  System.err.println("*** No data for index entry for: " + absFileName);
               else if (!Arrays.equals(hash, StringUtil.computeHash(sie.fileBytes)))
                  System.err.println("*** internal error - hashes of file do no match from the start!");
            }
            if (traceBuildSrcIndex)
               System.out.println("Adding buildSrcIndex " + relFileName + " : " + sie + " runtime: " + layeredSystem.getRuntimeName());
            l.buildSrcIndex.put(relFileName, sie);
            buildSrcIndexNeedsSave = true;
         }
      }
   }
public void addSrcFileIndex ( String relFileName , byte [ ] hash , String ext , String absFileName ) { if ( ! activated ) throw new UnsupportedOperationException ( ) ; for ( int i = layerPosition ; i < layeredSystem . layers . size ( ) ; i ++ ) { Layer l = layeredSystem . layers . get ( i ) ; if ( l . isBuildLayer ( ) ) { SrcIndexEntry sie = null ; if ( l . buildSrcIndex == null ) l . buildSrcIndex = l . readBuildSrcIndex ( ) ; else { sie = l . buildSrcIndex . get ( relFileName ) ; if ( sie != null ) { if ( Arrays . equals ( hash , sie . hash ) ) { sie . inUse = true ; continue ; } else { if ( layeredSystem . options . verboseLayerTypes && SrcIndexEntry . debugSrcIndexEntry ) { System . out . println ( "*** Adding mismatching entry in the same build layer?" ) ; String oldVersion = new String ( sie . fileBytes ) ; String newVersion = FileUtil . getFileAsString ( absFileName ) ; } } } } if ( sie == null ) sie = new SrcIndexEntry ( ) ; sie . hash = hash ; sie . inUse = true ; sie . extension = ext ; sie . layerName = getLayerName ( ) ; sie . srcIndexLayer = l ; if ( SrcIndexEntry . debugSrcIndexEntry ) { sie . updateDebugFileInfo ( absFileName ) ; if ( sie . fileBytes == null ) System . err . println ( "*** No data for index entry for: " + absFileName ) ; else if ( ! Arrays . equals ( hash , StringUtil . computeHash ( sie . fileBytes ) ) ) System . err . println ( "*** internal error - hashes of file do no match from the start!" ) ; } if ( traceBuildSrcIndex ) System . out . println ( "Adding buildSrcIndex " + relFileName + " : " + sie + " runtime: " + layeredSystem . getRuntimeName ( ) ) ; l . buildSrcIndex . put ( relFileName , sie ) ; buildSrcIndexNeedsSave = true ; } } }
Register the source file in any build layers including or following this one
Register the source file in any build layers including or following this one
// Layer may not have been started yet - if we are building one layer to produce classes needed to // start the next layer