Program: 91461
Project: 91461
Buggy source:
/** 
 * Updates prefixes to workspace paths
 * @param sb
 * @param diffFmt
 */
public void updateWorkspacePatchPrefixes(StringBuilder sb,DiffFormatter diffFmt){
  RawText rt=new RawText(sb.toString().getBytes());
  final String oldPrefix=diffFmt.getOldPrefix();
  final String newPrefix=diffFmt.getNewPrefix();
  StringBuilder newSb=new StringBuilder();
  final Pattern diffPattern=Pattern.compile("String_Node_Str" + oldPrefix + "String_Node_Str"+ newPrefix+ "String_Node_Str");
  final Pattern oldPattern=Pattern.compile("String_Node_Str" + oldPrefix + "String_Node_Str");
  final Pattern newPattern=Pattern.compile("String_Node_Str" + newPrefix + "String_Node_Str");
  int i=0;
  while (i < rt.size()) {
    String line=rt.getString(i);
    Matcher diffMatcher=diffPattern.matcher(line);
    Matcher oldMatcher=oldPattern.matcher(line);
    Matcher newMatcher=newPattern.matcher(line);
    if (diffMatcher.find()) {
      String group=diffMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(diffMatcher.group(1),newPath.toString());
      group=diffMatcher.group(4);
      newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(diffMatcher.group(3),newPath.toString());
    }
 else     if (oldMatcher.find()) {
      String group=oldMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(oldMatcher.group(1),newPath.toString());
    }
 else     if (newMatcher.find()) {
      String group=newMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(newMatcher.group(1),newPath.toString());
    }
    newSb.append(line);
    i++;
    if (i < rt.size() || !rt.isMissingNewlineAtEnd())     newSb.append(rt.getLineDelimiter());
  }
  sb.setLength(0);
  sb.append(newSb);
}

Fixed version (ground truth):
/** 
 * Updates prefixes to workspace paths
 * @param sb
 * @param diffFmt
 */
public void updateWorkspacePatchPrefixes(StringBuilder sb,DiffFormatter diffFmt){
  RawText rt;
  try {
    rt=new RawText(sb.toString().getBytes("String_Node_Str"));
  }
 catch (  UnsupportedEncodingException e) {
    throw new RuntimeException(e);
  }
  final String oldPrefix=diffFmt.getOldPrefix();
  final String newPrefix=diffFmt.getNewPrefix();
  StringBuilder newSb=new StringBuilder();
  final Pattern diffPattern=Pattern.compile("String_Node_Str" + oldPrefix + "String_Node_Str"+ newPrefix+ "String_Node_Str");
  final Pattern oldPattern=Pattern.compile("String_Node_Str" + oldPrefix + "String_Node_Str");
  final Pattern newPattern=Pattern.compile("String_Node_Str" + newPrefix + "String_Node_Str");
  int i=0;
  while (i < rt.size()) {
    String line=rt.getString(i);
    Matcher diffMatcher=diffPattern.matcher(line);
    Matcher oldMatcher=oldPattern.matcher(line);
    Matcher newMatcher=newPattern.matcher(line);
    if (diffMatcher.find()) {
      String group=diffMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(diffMatcher.group(1),newPath.toString());
      group=diffMatcher.group(4);
      newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(diffMatcher.group(3),newPath.toString());
    }
 else     if (oldMatcher.find()) {
      String group=oldMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(oldMatcher.group(1),newPath.toString());
    }
 else     if (newMatcher.find()) {
      String group=newMatcher.group(2);
      IProject project=getProject(group);
      IPath newPath=computeWorkspacePath(new Path(group),project);
      line=line.replaceAll(newMatcher.group(1),newPath.toString());
    }
    newSb.append(line);
    i++;
    if (i < rt.size() || !rt.isMissingNewlineAtEnd())     newSb.append(rt.getLineDelimiter());
  }
  sb.setLength(0);
  sb.append(newSb);
}