Program: 126303
Project: 126303
Buggy source:
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();
}

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>();
  Set<String> commentStringSet=new HashSet<String>();
  int start=-1;
  int end=-2;
  char ch;
  boolean isInConstString=false;
  boolean isInCommentString=false;
  Character commentType=null;
  for (int i=0; i < length; i++) {
    ch=value.charAt(i);
    if (isInCommentString == false && ch == '\"') {
      if (isEscapeSequence(value,i)) {
        continue;
      }
      isInConstString=!isInConstString;
      if (isInConstString) {
        start=i;
      }
 else {
        end=i;
        quotaStrings.put(start,end);
      }
    }
 else     if (isInConstString == false) {
      if (isInCommentString) {
        if (commentType != null && commentType.equals('/') && (ch == '\r' || ch == '\n')) {
          isInCommentString=false;
          commentType=null;
          end=i;
        }
 else         if (commentType != null && commentType.equals('*') && ch == '/' && value.charAt(i - 1) == '*') {
          isInCommentString=false;
          commentType=null;
          end=i;
        }
        if (isInCommentString == false) {
          quotaStrings.put(start,end);
          commentStringSet.add(start + "String_Node_Str" + end);
        }
      }
 else {
        if ((ch == '/' || ch == '*') && 0 < i && (i - 1) != end && value.charAt(i - 1) == '/') {
          isInCommentString=true;
          commentType=ch;
          start=i - 1;
        }
      }
    }
  }
{
  }
  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 < vEnd) {
      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 (vEnd <= vStart) {
      subString=value.substring(start,end);
      if (!commentStringSet.contains(start + "String_Node_Str" + (end - 1)) && 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 (!commentStringSet.contains(start + "String_Node_Str" + (end - 1)) && 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();
}