Program: 36991
Project: 36991
Buggy source:
/** 
 * Process table body.
 * @param table the table
 * @param cells the cells
 * @param rowsbody the rowsbody
 * @param headrowscount the headrowscount
 * @param num_of_columns the num_of_columns
 * @return the table
 */
public Table ProcessTableBody(Table table,Cell[][] cells,List<Node> rowsbody,int headrowscount,int num_of_columns){
  int startj=headrowscount;
  for (int j=0; j < rowsbody.size(); j++) {
    table.stat.AddBodyRow();
    List<Node> tds=getChildrenByTagName(rowsbody.get(j),"String_Node_Str");
    int index=0;
    int rowindex=startj;
    for (int k=0; k < tds.size(); k++) {
      boolean isStub=false;
      float stubProbability=0;
      if (index == 0) {
        isStub=true;
        stubProbability=(float)0.9;
      }
      boolean is_colspanning=false;
      boolean is_rowspanning=false;
      int colspanVal=1;
      int rowspanVal=1;
      if (tds.get(k).getAttributes().getNamedItem("String_Node_Str") != null && Utilities.isNumeric(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) && Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setRowSpanning(true);
        Statistics.addRowSpanningCell();
        table.stat.AddRowSpanningCell();
        is_rowspanning=true;
        rowspanVal=Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
      }
      if (tds.get(k).getAttributes().getNamedItem("String_Node_Str") != null && Utilities.isNumeric(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) && Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setColSpanning(true);
        Statistics.addColumnSpanningCell();
        table.stat.AddColSpanningCell();
        is_colspanning=true;
        colspanVal=Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
      }
      for (int l=0; l < colspanVal; l++) {
        rowindex=startj + j;
        for (int s=0; s < rowspanVal; s++) {
          try {
            while (cells[rowindex][index].isIs_filled() && index != num_of_columns)             index++;
            cells[rowindex][index]=Cell.setCellValues(cells[rowindex][index],tds.get(k).getTextContent(),is_colspanning,colspanVal,is_rowspanning,rowspanVal,false,0,isStub,stubProbability,index,rowindex,l,s);
            table=Statistics.statisticsForCell(table,cells[rowindex][index]);
          }
 catch (          Exception ex) {
            System.out.println("String_Node_Str");
          }
          rowindex++;
        }
        index++;
      }
    }
  }
  return table;
}

Fixed version (ground truth):
/** 
 * Process table body.
 * @param table the table
 * @param cells the cells
 * @param rowsbody the rowsbody
 * @param headrowscount the headrowscount
 * @param num_of_columns the num_of_columns
 * @return the table
 */
public Table ProcessTableBody(Table table,Cell[][] cells,List<Node> rowsbody,int headrowscount,int num_of_columns){
  int startj=headrowscount;
  for (int j=0; j < rowsbody.size(); j++) {
    table.stat.AddBodyRow();
    List<Node> tds=getChildrenByTagName(rowsbody.get(j),"String_Node_Str");
    int index=0;
    int rowindex=startj;
    for (int k=0; k < tds.size(); k++) {
      boolean isStub=false;
      float stubProbability=0;
      if (index == 0) {
        isStub=true;
        stubProbability=(float)0.9;
      }
      boolean is_colspanning=false;
      boolean is_rowspanning=false;
      int colspanVal=1;
      int rowspanVal=1;
      if (tds.get(k).getAttributes().getNamedItem("String_Node_Str") != null && Utilities.isNumeric(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) && Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setRowSpanning(true);
        Statistics.addRowSpanningCell();
        table.stat.AddRowSpanningCell();
        is_rowspanning=true;
        rowspanVal=Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
      }
      if (tds.get(k).getAttributes().getNamedItem("String_Node_Str") != null && Utilities.isNumeric(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) && Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setColSpanning(true);
        Statistics.addColumnSpanningCell();
        table.stat.AddColSpanningCell();
        is_colspanning=true;
        colspanVal=Integer.parseInt(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue());
      }
      for (int l=0; l < colspanVal; l++) {
        rowindex=startj + j;
        for (int s=0; s < rowspanVal; s++) {
          try {
            while (cells[rowindex][index].isIs_filled() && index != num_of_columns)             index++;
            cells[rowindex][index]=Cell.setCellValues(cells[rowindex][index],Utilities.getString(tds.get(k)),is_colspanning,colspanVal,is_rowspanning,rowspanVal,false,0,isStub,stubProbability,index,rowindex,l,s);
            table=Statistics.statisticsForCell(table,cells[rowindex][index]);
          }
 catch (          Exception ex) {
            System.out.println("String_Node_Str");
          }
          rowindex++;
        }
        index++;
      }
    }
  }
  return table;
}