Program: 135898
Project: 135898
Buggy source:
/** 
 */
private void GenLabeledStmt(AST.LabeledStmt ast,String context) throws PcalTLAGenException {
  String actionName=ast.label;
  if (ParseAlgorithm.omitPC) {
    actionName=currentProcName;
  }
  StringBuffer sb=new StringBuffer(actionName);
  Changed c=new Changed(vars);
  if (mp && (context.equals("String_Node_Str") || selfIsSelf)) {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  int col=sb.length();
  kludgeToFixPCHandlingBug=col;
  sb.append("String_Node_Str");
  kludgeToFixPCHandlingBug=kludgeToFixPCHandlingBug + 3;
  int defStartLine=tlacode.size();
  int colAfterAnd=sb.length();
  addLeftParen(ast.getOrigin());
  for (int i=0; i < ast.stmts.size(); i++) {
    GenStmt((AST)ast.stmts.elementAt(i),c,context,sb.toString(),sb.length());
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
  }
  Vector unc=c.Unchanged(wrapColumn - col - "String_Node_Str".length());
  if (c.NumUnchanged() > 1) {
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
    int here=sb.length();
    sb.append((String)unc.elementAt(0));
    for (int i=1; i < unc.size(); i++) {
      addOneLineOfTLA(sb.toString());
      sb=new StringBuffer(NSpaces(here));
      sb.append((String)unc.elementAt(i));
    }
    sb.append("String_Node_Str");
    addOneTokenToTLA(sb.toString());
  }
 else   if (c.NumUnchanged() == 1) {
    if (c.Unchanged().length() > 5) {
      addOneTokenToTLA(NSpaces(col) + "String_Node_Str" + c.Unchanged());
    }
 else {
      addOneTokenToTLA(NSpaces(col) + "String_Node_Str" + c.Unchanged()+ "String_Node_Str"+ c.Unchanged());
    }
  }
 else {
    if (ast.stmts.size() == 1) {
      for (int i=defStartLine; i < tlacode.size(); i++) {
        String line=(String)tlacode.elementAt(i);
        if (i == defStartLine) {
          tlacode.setElementAt(line.substring(0,colAfterAnd - 3) + line.substring(colAfterAnd,line.length()),i);
          shiftMappingVectorTokensLeft(i,colAfterAnd,3);
        }
 else {
          if (line.length() > 3) {
            tlacode.setElementAt(line.substring(3,line.length()),i);
            shiftMappingVectorTokensLeft(i,colAfterAnd,3);
          }
        }
      }
    }
  }
  addRightParen(ast.getOrigin());
  addOneLineOfTLA("String_Node_Str");
}

Fixed version (ground truth):
/** 
 */
private void GenLabeledStmt(AST.LabeledStmt ast,String context) throws PcalTLAGenException {
  String actionName=ast.label;
  if (ParseAlgorithm.omitPC) {
    actionName=currentProcName;
  }
  StringBuffer sb=new StringBuffer(actionName);
  Changed c=new Changed(vars);
  if (mp && (context.equals("String_Node_Str") || selfIsSelf)) {
    sb.append("String_Node_Str");
  }
  sb.append("String_Node_Str");
  int col=sb.length();
  kludgeToFixPCHandlingBug=col;
  sb.append("String_Node_Str");
  kludgeToFixPCHandlingBug=kludgeToFixPCHandlingBug + 3;
  int defStartLine=tlacode.size();
  int colAfterAnd=sb.length();
  PCalLocation macroBeginLeft=null;
  PCalLocation macroEndRight=null;
  boolean nonNullNotFound=true;
  for (int i=0; i < ast.stmts.size(); i++) {
    AST stmt=(AST)ast.stmts.elementAt(i);
    if (stmt.getOrigin() != null) {
      if (nonNullNotFound) {
        nonNullNotFound=false;
        macroBeginLeft=stmt.macroOriginBegin;
      }
      macroEndRight=stmt.macroOriginEnd;
    }
  }
  addLeftParenV(ast,macroBeginLeft);
  for (int i=0; i < ast.stmts.size(); i++) {
    GenStmt((AST)ast.stmts.elementAt(i),c,context,sb.toString(),sb.length());
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
  }
  Vector unc=c.Unchanged(wrapColumn - col - "String_Node_Str".length());
  if (c.NumUnchanged() > 1) {
    sb=new StringBuffer(NSpaces(col));
    sb.append("String_Node_Str");
    int here=sb.length();
    sb.append((String)unc.elementAt(0));
    for (int i=1; i < unc.size(); i++) {
      addOneLineOfTLA(sb.toString());
      sb=new StringBuffer(NSpaces(here));
      sb.append((String)unc.elementAt(i));
    }
    sb.append("String_Node_Str");
    addOneTokenToTLA(sb.toString());
  }
 else   if (c.NumUnchanged() == 1) {
    if (c.Unchanged().length() > 5) {
      addOneTokenToTLA(NSpaces(col) + "String_Node_Str" + c.Unchanged());
    }
 else {
      addOneTokenToTLA(NSpaces(col) + "String_Node_Str" + c.Unchanged()+ "String_Node_Str"+ c.Unchanged());
    }
  }
 else {
    if (ast.stmts.size() == 1) {
      for (int i=defStartLine; i < tlacode.size(); i++) {
        String line=(String)tlacode.elementAt(i);
        if (i == defStartLine) {
          tlacode.setElementAt(line.substring(0,colAfterAnd - 3) + line.substring(colAfterAnd,line.length()),i);
          shiftMappingVectorTokensLeft(i,colAfterAnd,3);
        }
 else {
          if (line.length() > 3) {
            tlacode.setElementAt(line.substring(3,line.length()),i);
            shiftMappingVectorTokensLeft(i,colAfterAnd,3);
          }
        }
      }
    }
  }
  addRightParenV(ast,macroEndRight);
  addOneLineOfTLA("String_Node_Str");
}