Program: 27482
Project: 27482
Buggy source:
/** 
 * @return a mutable list
 * @throws IOException
 */
public static List<SourceFile> getBuiltinExterns(CompilerOptions options) throws IOException {
  InputStream input=CommandLineRunner.class.getResourceAsStream("String_Node_Str");
  if (input == null) {
    input=CommandLineRunner.class.getResourceAsStream("String_Node_Str");
  }
  Preconditions.checkNotNull(input);
  ZipInputStream zip=new ZipInputStream(input);
  final String envPrefix=options.getEnvironment().toString().toLowerCase() + "String_Node_Str";
  ImmutableList.Builder<ZipEntry> builder=ImmutableList.builder();
  for (ZipEntry entry=null; (entry=zip.getNextEntry()) != null; ) {
    builder.add(entry);
  }
  ImmutableList<ZipEntry> zipEntries=builder.build();
  boolean flatExternStructure=true;
  String browserEnv=CompilerOptions.Environment.BROWSER.toString().toLowerCase();
  for (  ZipEntry entry : zipEntries) {
    if (entry.getName().contains(browserEnv)) {
      flatExternStructure=false;
      break;
    }
  }
  Map<String,SourceFile> externsMap=new HashMap<>();
  for (  ZipEntry entry : zipEntries) {
    if (entry.getName().indexOf('/') < 0 || flatExternStructure || (entry.getName().indexOf(envPrefix) == 0 && entry.getName().length() > envPrefix.length())) {
      BufferedInputStream entryStream=new BufferedInputStream(ByteStreams.limit(zip,entry.getSize()));
      externsMap.put(entry.getName(),SourceFile.fromInputStream("String_Node_Str" + entry.getName(),entryStream,UTF_8));
    }
  }
  List<SourceFile> externs=new ArrayList<>();
  for (  String key : BUILTIN_LANG_EXTERNS) {
    Preconditions.checkState(externsMap.containsKey(key),"String_Node_Str",key);
    externs.add(externsMap.remove(key));
  }
  for (  String key : BUILTIN_EXTERN_DEP_ORDER) {
    if (!key.contains(envPrefix)) {
      continue;
    }
    Preconditions.checkState(externsMap.containsKey(key),"String_Node_Str",key,options.getEnvironment());
    externs.add(externsMap.remove(key));
  }
  externs.addAll(externsMap.values());
  return externs;
}

Fixed version (ground truth):
/** 
 * @return a mutable list
 * @throws IOException
 */
public static List<SourceFile> getBuiltinExterns(CompilerOptions options) throws IOException {
  InputStream input=CommandLineRunner.class.getResourceAsStream("String_Node_Str");
  if (input == null) {
    input=CommandLineRunner.class.getResourceAsStream("String_Node_Str");
  }
  Preconditions.checkNotNull(input);
  ZipInputStream zip=new ZipInputStream(input);
  CompilerOptions.Environment env=options.getEnvironment();
  String envPrefix=env.toString().toLowerCase() + "String_Node_Str";
  String browserEnv=CompilerOptions.Environment.BROWSER.toString().toLowerCase();
  boolean flatExternStructure=true;
  Map<String,SourceFile> mapFromExternsZip=new HashMap<>();
  for (ZipEntry entry=null; (entry=zip.getNextEntry()) != null; ) {
    String filename=entry.getName();
    if (filename.contains(browserEnv)) {
      flatExternStructure=false;
    }
    if (!filename.contains("String_Node_Str") || (filename.indexOf(envPrefix) == 0 && filename.length() > envPrefix.length())) {
      BufferedInputStream entryStream=new BufferedInputStream(ByteStreams.limit(zip,entry.getSize()));
      mapFromExternsZip.put(filename,SourceFile.fromInputStream("String_Node_Str" + filename,entryStream,UTF_8));
    }
  }
  List<SourceFile> externs=new ArrayList<>();
  for (  String key : BUILTIN_LANG_EXTERNS) {
    Preconditions.checkState(mapFromExternsZip.containsKey(key),"String_Node_Str",key);
    externs.add(mapFromExternsZip.remove(key));
  }
  for (  String key : BUILTIN_EXTERN_DEP_ORDER) {
    if (!flatExternStructure && !key.contains(envPrefix)) {
      continue;
    }
    if (flatExternStructure) {
      key=key.substring(key.indexOf('/') + 1);
    }
    Preconditions.checkState(mapFromExternsZip.containsKey(key),"String_Node_Str",key,env);
    externs.add(mapFromExternsZip.remove(key));
  }
  externs.addAll(mapFromExternsZip.values());
  return externs;
}