Program: 101281
Project: 101281
Buggy source:
@Override public String preProcess(final HtmlPage htmlPage,final String sourceCode,final String sourceName,final int lineNumber,final HtmlElement htmlElement){
  final String normalizedSourceName=INLINE_SCRIPT_RE.matcher(sourceName).replaceAll("String_Node_Str");
  if (cacheInstrumentedCode && instrumentedScriptCache.containsKey(normalizedSourceName)) {
    final ScriptData data=instrumentedScriptCache.get(normalizedSourceName);
    scriptDataList.add(data);
    return data.getInstrumentedSourceCode();
  }
  if (shouldIgnore(normalizedSourceName)) {
    return sourceCode;
  }
  final ScriptData data;
  data=new ScriptData(normalizedSourceName,sourceCode);
  scriptDataList.add(data);
  final CompilerEnvirons environs=new CompilerEnvirons();
  environs.initFromContext(contextFactory.enterContext());
  final AstRoot root=new Parser(environs).parse(sourceCode,normalizedSourceName,lineNumber);
  root.visit(new InstrumentingVisitor(data));
  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,normalizedSourceName));
  for (  final Integer i : data.getLineNumbersOfAllStatements()) {
    buf.append(String.format(arrayInitializer,data.getSourceName(),i));
  }
  buf.append(treeSource);
  final String instrumentedCode=buf.toString();
  data.setInstrumentedSourceCode(instrumentedCode);
  if (cacheInstrumentedCode) {
    instrumentedScriptCache.putIfAbsent(normalizedSourceName,data);
  }
  if (outputInstrumentedFiles) {
synchronized (writtenToDisk) {
      try {
        if (!writtenToDisk.contains(normalizedSourceName)) {
          final File file=new File(normalizedSourceName);
          final File fileOutputDir=new File(outputDir,DigestUtils.md5Hex(file.getParent()));
          FileUtils.mkdir(fileOutputDir.getAbsolutePath());
          final File outputFile=new File(fileOutputDir,file.getName());
          logger.info("String_Node_Str",outputFile.getAbsolutePath());
          IOUtils.write(instrumentedCode,new FileOutputStream(outputFile));
          writtenToDisk.add(normalizedSourceName);
        }
      }
 catch (      final IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
  return instrumentedCode;
}

Fixed version (ground truth):
@Override public String preProcess(final HtmlPage htmlPage,final String sourceCode,final String sourceName,final int lineNumber,final HtmlElement htmlElement){
  final String normalizedSourceName=INLINE_SCRIPT_RE.matcher(sourceName).replaceAll("String_Node_Str");
  if (cacheInstrumentedCode && instrumentedScriptCache.containsKey(normalizedSourceName)) {
    final ScriptData data=instrumentedScriptCache.get(normalizedSourceName);
    scriptDataList.add(data);
    return data.getInstrumentedSourceCode();
  }
  if (shouldIgnore(normalizedSourceName)) {
    return sourceCode;
  }
  final ScriptData data;
  data=new ScriptData(normalizedSourceName,sourceCode);
  scriptDataList.add(data);
  final CompilerEnvirons environs=new CompilerEnvirons();
  environs.initFromContext(contextFactory.enterContext());
  final AstRoot root=new Parser(environs).parse(sourceCode,normalizedSourceName,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,normalizedSourceName));
  for (  final Integer i : data.getLineNumbersOfAllStatements()) {
    buf.append(String.format(arrayInitializer,data.getSourceName(),i));
  }
  buf.append(treeSource);
  final String instrumentedCode=buf.toString();
  data.setInstrumentedSourceCode(instrumentedCode);
  if (cacheInstrumentedCode) {
    instrumentedScriptCache.putIfAbsent(normalizedSourceName,data);
  }
  if (outputInstrumentedFiles) {
synchronized (writtenToDisk) {
      try {
        if (!writtenToDisk.contains(normalizedSourceName)) {
          final File file=new File(normalizedSourceName);
          final File fileOutputDir=new File(outputDir,DigestUtils.md5Hex(file.getParent()));
          FileUtils.mkdir(fileOutputDir.getAbsolutePath());
          final File outputFile=new File(fileOutputDir,file.getName());
          logger.info("String_Node_Str",outputFile.getAbsolutePath());
          IOUtils.write(instrumentedCode,new FileOutputStream(outputFile));
          writtenToDisk.add(normalizedSourceName);
        }
      }
 catch (      final IOException e) {
        throw new RuntimeException(e);
      }
    }
  }
  return instrumentedCode;
}