Program: 39550
Project: 39550
Buggy source:
private TOExecutionResult insertAfterRegex(BufferedReader readerText,BufferedReader readerOriginalFile,BufferedWriter writer,boolean firstOnly,String eol) throws IOException {
  String currentLine;
  int n=0;
  boolean foundFirstMatch=false;
  final Pattern pattern=Pattern.compile(regex);
  EolBufferedReader eolReaderOriginalFile=new EolBufferedReader(readerOriginalFile);
  StringBuilder readerTextStringBuilder=null;
  String readerTextString=null;
  if (!firstOnly) {
    readerTextStringBuilder=new StringBuilder();
  }
  while ((currentLine=eolReaderOriginalFile.readLineKeepEol()) != null) {
    writer.write(currentLine);
    if ((!firstOnly || !foundFirstMatch) && pattern.matcher(removeEol(currentLine)).matches()) {
      foundFirstMatch=true;
      n++;
      if (n == 1) {
        while ((currentLine=readerText.readLine()) != null) {
          writer.write(currentLine);
          writer.write(eol);
          if (!firstOnly) {
            readerTextStringBuilder.append(currentLine);
            readerTextStringBuilder.append(eol);
          }
        }
        if (!firstOnly) {
          readerTextString=readerTextStringBuilder.toString();
        }
      }
 else {
        writer.write(readerTextString);
      }
    }
  }
  if (foundFirstMatch) {
    String details=String.format("String_Node_Str",textFileUrl,getRelativePath(),n,regex);
    return TOExecutionResult.success(this,details);
  }
 else {
    String details=String.format("String_Node_Str",textFileUrl,getRelativePath(),regex);
    return TOExecutionResult.noOp(this,details);
  }
}

Fixed version (ground truth):
private TOExecutionResult insertAfterRegex(BufferedReader readerText,BufferedReader readerOriginalFile,BufferedWriter writer,boolean firstOnly,String eol) throws IOException {
  String currentLine;
  int n=0;
  boolean foundFirstMatch=false;
  final Pattern pattern=Pattern.compile(regex);
  EolBufferedReader eolReaderOriginalFile=new EolBufferedReader(readerOriginalFile);
  StringBuilder readerTextStringBuilder=null;
  String readerTextString=null;
  if (!firstOnly) {
    readerTextStringBuilder=new StringBuilder();
  }
  while ((currentLine=eolReaderOriginalFile.readLineKeepEol()) != null) {
    writer.write(currentLine);
    if ((!firstOnly || !foundFirstMatch) && pattern.matcher(removeEol(currentLine)).matches()) {
      foundFirstMatch=true;
      n++;
      if (getEndEol(currentLine) == null) {
        writer.write(eol);
      }
      if (n == 1) {
        while ((currentLine=readerText.readLine()) != null) {
          writer.write(currentLine);
          writer.write(eol);
          if (!firstOnly) {
            readerTextStringBuilder.append(currentLine);
            readerTextStringBuilder.append(eol);
          }
        }
        if (!firstOnly) {
          readerTextString=readerTextStringBuilder.toString();
        }
      }
 else {
        writer.write(readerTextString);
      }
    }
  }
  if (foundFirstMatch) {
    String details=String.format("String_Node_Str",textFileUrl,getRelativePath(),n,regex);
    return TOExecutionResult.success(this,details);
  }
 else {
    String details=String.format("String_Node_Str",textFileUrl,getRelativePath(),regex);
    return TOExecutionResult.noOp(this,details);
  }
}