src/com/google/javascript/jscomp/AbstractCommandLineRunner.java
/**
   * Check that relative paths inside zip files are unique, since multiple files with the same path
   * inside different zips are considered duplicate inputs. Parameter {@code sourceFiles} may be
   * modified if duplicates are removed.
   */
Check that relative paths inside zip files are unique, since multiple files with the same path
inside different zips are considered duplicate inputs. Parameter  sourceFiles may be
modified if duplicates are removed.
Check that relative paths inside zip files are unique since multiple files with the same path inside different zips are considered duplicate inputs . Parameter sourceFiles may be modified if duplicates are removed .
@GwtIncompatible("Unnecessary")
  public static ImmutableList<JSError> removeDuplicateZipEntries(
      List<SourceFile> sourceFiles, List<JsModuleSpec> jsModuleSpecs) throws IOException {
    ImmutableList.Builder<JSError> errors = ImmutableList.builder();
    Map<String, SourceFile> sourceFilesByName = new HashMap<>();
    Iterator<SourceFile> fileIterator = sourceFiles.iterator();
    int currentFileIndex = 0;
    Iterator<JsModuleSpec> moduleIterator = jsModuleSpecs.iterator();
    int cumulatedJsFileNum = 0;
    JsModuleSpec currentModule = null;
    while (fileIterator.hasNext()) {
      SourceFile sourceFile = fileIterator.next();
      currentFileIndex++;
      if (moduleIterator.hasNext() && currentFileIndex > cumulatedJsFileNum) {
        currentModule = moduleIterator.next();
        cumulatedJsFileNum += currentModule.numJsFiles;
      }
      String fullPath = sourceFile.getName();
      if (!fullPath.contains("!/")) {
        continue;
      }
      String relativePath = fullPath.split("!")[1];
      if (!sourceFilesByName.containsKey(relativePath)) {
        sourceFilesByName.put(relativePath, sourceFile);
      } else {
        SourceFile firstSourceFile = sourceFilesByName.get(relativePath);
        if (firstSourceFile.getCode().equals(sourceFile.getCode())) {
          fileIterator.remove();
          if (currentModule != null) {
            currentModule.numJsFiles--;
          }
        } else {
          errors.add(
              JSError.make(
                  CONFLICTING_DUPLICATE_ZIP_CONTENTS,
                  firstSourceFile.getName(),
                  sourceFile.getName()));
        }
      }
    }
    return errors.build();
  }
@ GwtIncompatible ( "Unnecessary" ) public static ImmutableList < JSError > removeDuplicateZipEntries ( List < SourceFile > sourceFiles , List < JsModuleSpec > jsModuleSpecs ) throws IOException { ImmutableList . Builder < JSError > errors = ImmutableList . builder ( ) ; Map < String , SourceFile > sourceFilesByName = new HashMap < > ( ) ; Iterator < SourceFile > fileIterator = sourceFiles . iterator ( ) ; int currentFileIndex = 0 ; Iterator < JsModuleSpec > moduleIterator = jsModuleSpecs . iterator ( ) ; int cumulatedJsFileNum = 0 ; JsModuleSpec currentModule = null ; while ( fileIterator . hasNext ( ) ) { SourceFile sourceFile = fileIterator . next ( ) ; currentFileIndex ++ ; if ( moduleIterator . hasNext ( ) && currentFileIndex > cumulatedJsFileNum ) { currentModule = moduleIterator . next ( ) ; cumulatedJsFileNum += currentModule . numJsFiles ; } String fullPath = sourceFile . getName ( ) ; if ( ! fullPath . contains ( "!/" ) ) { continue ; } String relativePath = fullPath . split ( "!" ) [ 1 ] ; if ( ! sourceFilesByName . containsKey ( relativePath ) ) { sourceFilesByName . put ( relativePath , sourceFile ) ; } else { SourceFile firstSourceFile = sourceFilesByName . get ( relativePath ) ; if ( firstSourceFile . getCode ( ) . equals ( sourceFile . getCode ( ) ) ) { fileIterator . remove ( ) ; if ( currentModule != null ) { currentModule . numJsFiles -- ; } } else { errors . add ( JSError . make ( CONFLICTING_DUPLICATE_ZIP_CONTENTS , firstSourceFile . getName ( ) , sourceFile . getName ( ) ) ) ; } } } return errors . build ( ) ; }
Check that relative paths inside zip files are unique, since multiple files with the same path
 inside different zips are considered duplicate inputs.
Check that relative paths inside zip files are unique since multiple files with the same path inside different zips are considered duplicate inputs .
// Tracks the total number of js files for current module and all the previous modules. // Check whether we reached the next module. // Not a zip file