Program: 18386
Project: 18386
Buggy source:
public static void compose(FSTTerminal terminalA,FSTTerminal terminalB,FSTTerminal terminalComp,FSTNonTerminal nonterminalParent){
  if (terminalA.getBody().matches("String_Node_Str")) {
    FSTTerminal terminalComp2=(FSTTerminal)terminalB.getDeepClone();
    nonterminalParent.addChild(terminalComp2);
    String oldMethodName=terminalB.getName();
    StringTokenizer st=new StringTokenizer(oldMethodName,"String_Node_Str");
    if (st.hasMoreTokens()) {
      oldMethodName=st.nextToken();
    }
    st=new StringTokenizer(oldMethodName,"String_Node_Str");
    while (st.hasMoreTokens()) {
      oldMethodName=st.nextToken();
    }
    String toReplace="String_Node_Str";
    String newMethodName=oldMethodName + "String_Node_Str" + getFeatureName(terminalB);
    String newBody=terminalComp.getBody().replaceAll(toReplace,newMethodName + "String_Node_Str");
    terminalComp.setBody(newBody);
    String auxBody="String_Node_Str";
    st=new StringTokenizer(terminalComp2.getBody(),"String_Node_Str");
    if (st.hasMoreTokens()) {
      auxBody=st.nextToken();
    }
    st=new StringTokenizer(auxBody,"String_Node_Str");
    String prefix="String_Node_Str";
    boolean found=false;
    while (st.hasMoreTokens() && !found) {
      String token=st.nextToken();
      if (oldMethodName.equals(token)) {
        found=true;
      }
 else {
        prefix+=token + "String_Node_Str";
      }
    }
    terminalComp2.setBody(prefix + terminalComp2.getBody().replaceFirst(prefix,"String_Node_Str").replaceFirst(oldMethodName,newMethodName));
    terminalComp2.setName(newMethodName);
  }
}

Fixed version (ground truth):
public static void compose(FSTTerminal terminalA,FSTTerminal terminalB,FSTTerminal terminalComp,FSTNonTerminal nonterminalParent){
  if (terminalA.getBody().matches("String_Node_Str")) {
    FSTTerminal terminalComp2=(FSTTerminal)terminalB.getDeepClone();
    nonterminalParent.addChild(terminalComp2);
    String oldMethodName=terminalB.getName();
    StringTokenizer st=new StringTokenizer(oldMethodName,"String_Node_Str");
    if (st.hasMoreTokens()) {
      oldMethodName=st.nextToken();
    }
    st=new StringTokenizer(oldMethodName,"String_Node_Str");
    while (st.hasMoreTokens()) {
      oldMethodName=st.nextToken();
    }
    String toReplace="String_Node_Str";
    String newMethodName=oldMethodName + "String_Node_Str" + getFeatureName(terminalB);
    String newBody=terminalComp.getBody().replaceAll(toReplace,newMethodName + "String_Node_Str");
    terminalComp.setBody(newBody);
    String auxBody="String_Node_Str";
    st=new StringTokenizer(terminalComp2.getBody(),"String_Node_Str");
    if (st.hasMoreTokens()) {
      auxBody=st.nextToken();
    }
    st=new StringTokenizer(auxBody,"String_Node_Str");
    String prefix="String_Node_Str";
    boolean found=false;
    while (st.hasMoreTokens() && !found) {
      String token=st.nextToken();
      if (oldMethodName.equals(token)) {
        found=true;
      }
 else {
        prefix+=token + "String_Node_Str";
      }
    }
    System.out.println("String_Node_Str" + prefix);
    String modPrefix="String_Node_Str";
    for (    char c : prefix.toCharArray()) {
      if (c == '[')       modPrefix+="String_Node_Str";
 else       if (c == ']')       modPrefix+="String_Node_Str";
 else       modPrefix+=String.valueOf(c);
    }
    prefix=modPrefix;
    System.out.println("String_Node_Str" + prefix);
    terminalComp2.setBody(prefix + terminalComp2.getBody().replaceFirst(prefix,"String_Node_Str").replaceFirst(oldMethodName,newMethodName));
    terminalComp2.setName(newMethodName);
  }
}