Program: 36961
Project: 36961
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(Article a,Table table,Cell[][] cells,List<Node> rowsbody,int headrowscount,int num_of_columns){
  int startj=headrowscount;
  boolean tablecounted=false;
  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++) {
      table.stat.AddUnprCell();
      List<Node> hr=getChildrenByTagName(tds.get(k),"String_Node_Str");
      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()) && Utilities.getFirstValue(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setRowSpanning(true);
        Statistics.addRowSpanningCell();
        table.stat.AddRowSpanningCell();
        is_rowspanning=true;
        rowspanVal=Utilities.getFirstValue(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()) && Utilities.getFirstValue(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setColSpanning(true);
        Statistics.addColumnSpanningCell();
        table.stat.AddColSpanningCell();
        is_colspanning=true;
        colspanVal=Utilities.getFirstValue(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(a,cells[rowindex][index],Utilities.getString(tds.get(k)),is_colspanning,colspanVal,is_rowspanning,rowspanVal,false,0,isStub,stubProbability,index,rowindex,l,s);
            if (hr != null && hr.size() != 0 && hr.get(0) != null)             cells[rowindex][index].setBreakingLineOverRow(true);
            table=Statistics.statisticsForCell(table,cells[rowindex][index]);
          }
 catch (          Exception ex) {
            System.out.println("String_Node_Str");
          }
          rowindex++;
        }
        index++;
      }
    }
  }
  table.stat.setNum_columns(num_of_columns);
  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(Article a,Table table,Cell[][] cells,List<Node> rowsbody,int headrowscount,int num_of_columns){
  int startj=headrowscount;
  boolean tablecounted=false;
  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++) {
      table.stat.AddUnprCell();
      List<Node> hr=getChildrenByTagName(tds.get(k),"String_Node_Str");
      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()) && Utilities.getFirstValue(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setRowSpanning(true);
        Statistics.addRowSpanningCell();
        table.stat.AddRowSpanningCell();
        is_rowspanning=true;
        rowspanVal=Utilities.getFirstValue(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()) && Utilities.getFirstValue(tds.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue()) > 1) {
        table.setColSpanning(true);
        Statistics.addColumnSpanningCell();
        table.stat.AddColSpanningCell();
        is_colspanning=true;
        colspanVal=Utilities.getFirstValue(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(a,cells[rowindex][index],Utilities.getString(tds.get(k)),is_colspanning,colspanVal,is_rowspanning,rowspanVal,false,0,isStub,stubProbability,index,rowindex,l,s);
            if (hr != null && hr.size() != 0 && hr.get(0) != null) {
              cells[rowindex][index].setBreakingLineOverRow(true);
              isStub=false;
            }
            table=Statistics.statisticsForCell(table,cells[rowindex][index]);
          }
 catch (          Exception ex) {
            System.out.println("String_Node_Str");
          }
          rowindex++;
        }
        index++;
      }
    }
  }
  table.stat.setNum_columns(num_of_columns);
  return table;
}