Program: 101247
Project: 101247
Buggy source:
@Override public String preProcess(final HtmlPage htmlPage,final String sourceCode,final String sourceName,final int lineNumber,final HtmlElement htmlElement){
  try {
    final String normalizedSourceName=handleEvals(handleInlineScripts(sourceName));
    if (shouldIgnore(normalizedSourceName)) {
      return sourceCode;
    }
    final boolean separateFile=isSeparateFile(sourceName,normalizedSourceName);
    final URI sourceUri=URI.create(normalizedSourceName).normalize();
    if (config.isCacheInstrumentedCode() && instrumentedScriptCache.containsKey(sourceUri)) {
      final ScriptData data=instrumentedScriptCache.get(sourceUri);
      scriptDataList.add(data);
      return data.getInstrumentedSourceCode();
    }
    final ScriptData data=new ScriptData(sourceUri.toString(),sourceCode,separateFile);
    scriptDataList.add(data);
    final CompilerEnvirons environs=new CompilerEnvirons();
    environs.initFromContext(contextFactory.enterContext());
    final AstRoot root=new Parser(environs).parse(data.getSourceCode(),data.getSourceName(),lineNumber);
    root.visit(new InstrumentingVisitor(data,lineNumber - 1));
    final String treeSource=root.toSource();
    final StringBuilder buf=new StringBuilder(initializingCode.length() + data.getNumberOfStatements() * arrayInitializer.length() + treeSource.length());
    buf.append(initializingCode);
    buf.append(String.format("String_Node_Str",coverageVariableName,escapePath(data.getSourceName())));
    for (    final Integer i : data.getLineNumbersOfAllStatements()) {
      buf.append(String.format(arrayInitializer,escapePath(data.getSourceName()),i));
    }
    buf.append(treeSource);
    final String instrumentedCode=buf.toString();
    data.setInstrumentedSourceCode(instrumentedCode);
    if (config.isCacheInstrumentedCode()) {
      instrumentedScriptCache.putIfAbsent(URI.create(data.getSourceName()),data);
    }
    if (config.isOutputInstrumentedFiles() && separateFile) {
synchronized (writtenToDisk) {
        try {
          if (!writtenToDisk.contains(data.getSourceName())) {
            final File file=new File(data.getSourceName());
            final File fileOutputDir=new File(instrumentedFileDirectory,Hashing.md5().hashString(file.getParent()).toString());
            FileUtils.mkdir(fileOutputDir.getAbsolutePath());
            final File outputFile=new File(fileOutputDir,file.getName());
            logger.info("String_Node_Str",outputFile.getAbsolutePath());
            ByteStreams.write(instrumentedCode.getBytes("String_Node_Str"),Files.newOutputStreamSupplier(outputFile));
            writtenToDisk.add(data.getSourceName());
          }
        }
 catch (        final IOException e) {
          throw new RuntimeException(e);
        }
      }
    }
    return instrumentedCode;
  }
 catch (  final RuntimeException e) {
    logger.error("String_Node_Str",e);
    return sourceCode;
  }
}

Fixed version (ground truth):
@Override public String preProcess(final HtmlPage htmlPage,final String sourceCode,final String sourceName,final int lineNumber,final HtmlElement htmlElement){
  try {
    final String normalizedSourceName=handleEvals(handleInlineScripts(sourceName));
    if (shouldIgnore(normalizedSourceName)) {
      return sourceCode;
    }
    final boolean separateFile=isSeparateFile(sourceName,normalizedSourceName);
    final URI sourceUri=URI.create(normalizedSourceName).normalize();
    if (config.isCacheInstrumentedCode() && instrumentedScriptCache.containsKey(sourceUri)) {
      final ScriptData data=instrumentedScriptCache.get(sourceUri);
      scriptDataList.add(data);
      return data.getInstrumentedSourceCode();
    }
    final ScriptData data=new ScriptData(sourceUri,sourceCode,separateFile);
    scriptDataList.add(data);
    final CompilerEnvirons environs=new CompilerEnvirons();
    environs.initFromContext(contextFactory.enterContext());
    final AstRoot root=new Parser(environs).parse(data.getSourceCode(),data.getSourceUriAsString(),lineNumber);
    root.visit(new InstrumentingVisitor(data,lineNumber - 1));
    final String treeSource=root.toSource();
    final StringBuilder buf=new StringBuilder(initializingCode.length() + data.getNumberOfStatements() * arrayInitializer.length() + treeSource.length());
    buf.append(initializingCode);
    buf.append(String.format("String_Node_Str",coverageVariableName,escapePath(data.getSourceUriAsString())));
    for (    final Integer i : data.getLineNumbersOfAllStatements()) {
      buf.append(String.format(arrayInitializer,escapePath(data.getSourceUriAsString()),i));
    }
    buf.append(treeSource);
    final String instrumentedCode=buf.toString();
    data.setInstrumentedSourceCode(instrumentedCode);
    if (config.isCacheInstrumentedCode()) {
      instrumentedScriptCache.putIfAbsent(sourceUri,data);
    }
    if (config.isOutputInstrumentedFiles() && separateFile) {
synchronized (writtenToDisk) {
        try {
          if (!writtenToDisk.contains(sourceUri)) {
            final String parent=UriUtil.getParentOfLastSegmentOrHost(sourceUri);
            final String fileName=UriUtil.getLastSegmentOrHost(sourceUri);
            final File fileOutputDir=new File(instrumentedFileDirectory,Hashing.md5().hashString(parent).toString());
            FileUtils.mkdir(fileOutputDir.getAbsolutePath());
            final File outputFile=new File(fileOutputDir,fileName);
            logger.info("String_Node_Str",outputFile.getAbsolutePath());
            ByteStreams.write(instrumentedCode.getBytes("String_Node_Str"),Files.newOutputStreamSupplier(outputFile));
            writtenToDisk.add(sourceUri);
          }
        }
 catch (        final IOException e) {
          throw new RuntimeException(e);
        }
      }
    }
    return instrumentedCode;
  }
 catch (  final RuntimeException e) {
    logger.error("String_Node_Str",e);
    return sourceCode;
  }
}