Program: 71353
Project: 71353
Buggy source:
private CellArea createEmptyCell(CellArea upperCell,int columnId,Row row,Row lastRow){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan();
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getArea().getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=AreaFactory.createCellArea(cellContent);
  emptyCell.setRowSpan(rowSpan);
  row.addArea(emptyCell);
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      cellCache[1]=(ICellContent)lastRow.getCell(emptyCellColID - 1).getContent();
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
 else {
      cellCache[1]=(ICellContent)leftSideCellArea.getContent();
    }
  }
 else {
    leftSideCellArea=null;
  }
  resolveBorderConflict(emptyCell,true);
  IStyle areaStyle=emptyCell.getStyle();
  areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
  areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.getArea().indexOf(leftSideCellArea);
    row.getArea().addChild(index + 1,emptyCell);
  }
 else {
    row.getArea().addChild(0,emptyCell);
  }
  return emptyCell;
}

Fixed version (ground truth):
private CellArea createEmptyCell(CellArea upperCell,int columnId,Row row,Row lastRow){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan();
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getArea().getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=AreaFactory.createCellArea(cellContent);
  emptyCell.setRowSpan(rowSpan);
  row.addArea(emptyCell);
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      cellCache[0]=(ICellContent)lastRow.getCell(emptyCellColID - 1).getContent();
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
 else {
      cellCache[0]=(ICellContent)leftSideCellArea.getContent();
    }
  }
 else {
    leftSideCellArea=null;
  }
  resolveBorderConflict(emptyCell,true);
  IStyle areaStyle=emptyCell.getStyle();
  areaStyle.setProperty(IStyle.STYLE_PADDING_TOP,IStyle.NUMBER_0);
  areaStyle.setProperty(IStyle.STYLE_MARGIN_TOP,IStyle.NUMBER_0);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.getArea().indexOf(leftSideCellArea);
    row.getArea().addChild(index + 1,emptyCell);
  }
 else {
    row.getArea().addChild(0,emptyCell);
  }
  return emptyCell;
}