Program: 130174
Project: 130174
Buggy source:
public static String splitQueryData(String oldName,String newName,String value){
  final int length=value.length();
  LinkedHashMap<Integer,Integer> quotaStrings=new LinkedHashMap<Integer,Integer>();
  List<Point> functionNameAreas=new ArrayList<Point>();
  int start=-1;
  int end=-2;
  char ch;
  for (int i=0; i < length; i++) {
    ch=value.charAt(i);
    if (ch == '\"') {
      if (isEscapeSequence(value,i)) {
        continue;
      }
      if (0 <= start && end < start) {
        end=i;
        quotaStrings.put(start,end);
      }
 else {
        start=i;
      }
    }
  }
{
  }
  StringBuffer strBuffer=new StringBuffer();
  String subString=null;
  int vStart=0;
  int vEnd=0;
  int methodMaxIndex=0;
  int calcMaxIndex=0;
  start=0;
  end=0;
  for (  Entry<Integer,Integer> entry : quotaStrings.entrySet()) {
    start=entry.getKey();
    end=entry.getValue() + 1;
    vEnd=start;
    if (vStart == start) {
      subString=value.substring(start,end);
      if (start < methodMaxIndex) {
        subString=subString.replaceAll(oldName,newName);
      }
    }
 else {
      subString=value.substring(vStart,vEnd);
      calcMaxIndex=calcMethodArea(subString,value,vStart,functionNameAreas,methodMaxIndex);
      if (methodMaxIndex < calcMaxIndex) {
        methodMaxIndex=calcMaxIndex;
      }
      String replacedString=doVaribleReplace(oldName,newName,value,functionNameAreas,vStart,vEnd);
      strBuffer.append(replacedString);
      subString=value.substring(start,end);
      if (start < methodMaxIndex) {
        subString=subString.replaceAll(oldName,newName);
      }
    }
    strBuffer.append(subString);
    vStart=end;
  }
  if (vStart < length) {
    vEnd=length;
    String replacedString=doVaribleReplace(oldName,newName,value,functionNameAreas,vStart,vEnd);
    strBuffer.append(replacedString);
  }
  return strBuffer.toString();
}

Fixed version (ground truth):
public static String splitQueryData(String oldName,String newName,String value){
  inputString=value;
  final int length=value.length();
  LinkedHashMap<Integer,Integer> quotaStrings=new LinkedHashMap<Integer,Integer>();
  List<FunctionInfo> functions=new ArrayList<FunctionInfo>();
  int start=-1;
  int end=-2;
  char ch;
  for (int i=0; i < length; i++) {
    ch=value.charAt(i);
    if (ch == '\"') {
      if (isEscapeSequence(value,i)) {
        continue;
      }
      if (0 <= start && end < start) {
        end=i;
        quotaStrings.put(start,end);
      }
 else {
        start=i;
      }
    }
  }
{
  }
  StringBuffer strBuffer=new StringBuffer();
  String subString=null;
  int vStart=0;
  int vEnd=0;
  int methodMaxIndex=-1;
  vStart=0;
  vEnd=0;
  start=0;
  end=0;
  for (  Entry<Integer,Integer> entry : quotaStrings.entrySet()) {
    start=entry.getKey();
    end=entry.getValue() + 1;
    vEnd=start;
    if (vStart != start) {
      subString=value.substring(vStart,vEnd);
      calcMethodArea(subString,value,vStart,functions);
    }
    vStart=end;
  }
  vStart=0;
  vEnd=0;
  start=0;
  end=0;
  for (  Entry<Integer,Integer> entry : quotaStrings.entrySet()) {
    start=entry.getKey();
    end=entry.getValue() + 1;
    vEnd=start;
    if (vStart == start) {
      subString=value.substring(start,end);
      if (start < methodMaxIndex) {
        subString=subString.replaceAll(oldName,newName);
      }
    }
 else {
      subString=value.substring(vStart,vEnd);
      if (methodMaxIndex < start) {
        methodMaxIndex=FunctionInfo.getMaxIndexForCurrentParentFunction(start,functions);
      }
      String replacedString=doVaribleReplace(oldName,newName,value,functions,vStart,vEnd);
      strBuffer.append(replacedString);
      subString=value.substring(start,end);
      if (start < methodMaxIndex) {
        FunctionInfo function=FunctionInfo.getParentFunctionFromList(start,end,functions);
        Point funcNameArea=function.getNameArea();
        String functionName=value.substring(funcNameArea.x,funcNameArea.y);
        if (functionName.matches("String_Node_Str")) {
          subString=subString.replaceAll(oldName,newName);
        }
 else {
          if (subString.equals("String_Node_Str" + oldName + "String_Node_Str")) {
            subString="String_Node_Str" + newName + "String_Node_Str";
          }
        }
      }
    }
    strBuffer.append(subString);
    vStart=end;
  }
  if (vStart < length) {
    vEnd=length;
    String replacedString=doVaribleReplace(oldName,newName,value,functions,vStart,vEnd);
    strBuffer.append(replacedString);
  }
  return strBuffer.toString();
}