Program: 135865
Project: 135865
Buggy source:
/** 
 * @param pfStepVec   The vector to which proof steps should be added.
 * @param childVec    The vector of CASE assumptions' NodeRepresentation objects, which may include OR_DECOMP nodes.
 * @param assumptionsText The assumptions that must be prepended to a each case.
 */
void addCaseProofs(Vector<String[]> pfStepVec,Vector<NodeRepresentation> childVec,String[] assumpArray,String[] proofText){
  int newAssumpCount=assumpArray.length;
  NodeRepresentation lastChildNode=childVec.elementAt(childVec.size() - 1);
  int lenOfChildAssumps=childVec.size();
  if (lastChildNode.nodeType == NodeRepresentation.OR_DECOMP) {
    lenOfChildAssumps--;
  }
  for (int i=0; i < lenOfChildAssumps; i++) {
    newAssumpCount=newAssumpCount + childVec.elementAt(i).primedNodeText().length;
  }
  String[] newAssumpArray=new String[newAssumpCount];
  for (int i=0; i < assumpArray.length; i++) {
    newAssumpArray[i]=assumpArray[i];
  }
  if (lenOfChildAssumps > 0) {
    if (assumpArray.length > 0) {
      newAssumpArray[assumpArray.length - 1]=newAssumpArray[assumpArray.length - 1] + "String_Node_Str";
    }
    int idx=assumpArray.length;
    for (int i=0; i < lenOfChildAssumps; i++) {
      String[] assump=childVec.elementAt(i).primedNodeText();
      for (int j=0; j < assump.length; j++) {
        newAssumpArray[idx]=assump[j];
        idx++;
      }
      if (i != lenOfChildAssumps - 1) {
        newAssumpArray[idx - 1]=newAssumpArray[idx - 1] + "String_Node_Str";
      }
    }
  }
  if (lastChildNode.nodeType == NodeRepresentation.OR_DECOMP) {
    for (int i=0; i < lastChildNode.children.size(); i++) {
      addCaseProofs(pfStepVec,lastChildNode.children.elementAt(i),newAssumpArray,proofText);
    }
  }
 else {
    String[] step;
    if (newAssumpArray.length == 0) {
      step=prependToStringArray(lastChildNode.primedNodeText(),"String_Node_Str");
    }
 else {
      step=concatStringArrays(prependToStringArray(newAssumpArray,"String_Node_Str"),prependToStringArray(this.goalRep.primedNodeText(),"String_Node_Str"));
    }
    step=prependToStringArray(step,proofLevelString + (pfStepVec.size() + 1) + STEP_NUMBER_PUNCTUATION+ "String_Node_Str");
    if (proofText != null) {
      step=concatStringArrays(step,proofText);
    }
    pfStepVec.add(step);
  }
}

Fixed version (ground truth):
/** 
 * Adds the proofs steps for a CASE decomposition.
 * @param pfStepVec   The vector to which proof steps should be added.
 * @param childVec    The vector of CASE assumptions' NodeRepresentation objects, which may include OR_DECOMP nodes.
 * @param assumpArray The assumptions that must be prepended to each case.
 * @param proofText   The user's proof, or null if none.
 */
void addCaseProofs(Vector<String[]> pfStepVec,Vector<NodeRepresentation> childVec,String[] assumpArray,String[] proofText){
  int newAssumpCount=assumpArray.length;
  NodeRepresentation lastChildNode=childVec.elementAt(childVec.size() - 1);
  int lenOfChildAssumps=childVec.size();
  if (lastChildNode.nodeType == NodeRepresentation.OR_DECOMP) {
    lenOfChildAssumps--;
  }
  for (int i=0; i < lenOfChildAssumps; i++) {
    newAssumpCount=newAssumpCount + childVec.elementAt(i).primedNodeText().length;
  }
  String[] newAssumpArray=new String[newAssumpCount];
  for (int i=0; i < assumpArray.length; i++) {
    newAssumpArray[i]=assumpArray[i];
  }
  if (lenOfChildAssumps > 0) {
    if (assumpArray.length > 0) {
      newAssumpArray[assumpArray.length - 1]=newAssumpArray[assumpArray.length - 1] + "String_Node_Str";
    }
    int idx=assumpArray.length;
    for (int i=0; i < lenOfChildAssumps; i++) {
      String[] assump=childVec.elementAt(i).primedNodeText();
      for (int j=0; j < assump.length; j++) {
        newAssumpArray[idx]=assump[j];
        idx++;
      }
      if (i != lenOfChildAssumps - 1) {
        newAssumpArray[idx - 1]=newAssumpArray[idx - 1] + "String_Node_Str";
      }
    }
  }
  if (lastChildNode.nodeType == NodeRepresentation.OR_DECOMP) {
    for (int i=0; i < lastChildNode.children.size(); i++) {
      addCaseProofs(pfStepVec,lastChildNode.children.elementAt(i),newAssumpArray,proofText);
    }
  }
 else {
    String[] step;
    if (newAssumpArray.length == 1 && useCaseButton.getSelection()) {
      step=prependToStringArray(lastChildNode.primedNodeText(),"String_Node_Str");
    }
 else {
      step=concatStringArrays(prependToStringArray(newAssumpArray,"String_Node_Str"),prependToStringArray(this.goalRep.primedNodeText(),"String_Node_Str"));
    }
    step=prependToStringArray(step,proofLevelString + (pfStepVec.size() + 1) + STEP_NUMBER_PUNCTUATION+ "String_Node_Str");
    if (proofText != null) {
      step=concatStringArrays(step,proofText);
    }
    pfStepVec.add(step);
  }
}