Program: 65351
Project: 65351
Buggy source:
private CellArea createEmptyCell(CellArea upperCell,int columnId,RowArea row){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan() - 1;
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=null;
  if (upperCell != null) {
    emptyCell=upperCell.cloneArea();
  }
 else {
    emptyCell=new CellArea();
    emptyCell.content=cellContent;
  }
  BoxStyle bs=emptyCell.getBoxStyle();
  if (bs == BoxStyle.DEFAULT)   bs=new BoxStyle(BoxStyle.DEFAULT);
  bs.setRightBorder(null);
  bs.setBottomBorder(null);
  emptyCell.setHeight(0);
  emptyCell.setRowSpan(rowSpan);
  CellArea originalCell=upperCell;
  if (upperCell instanceof DummyCell) {
    originalCell=((DummyCell)upperCell).getCell();
  }
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
  }
 else {
    leftSideCellArea=null;
  }
  emptyCell.setParent(row);
  row.setCell(emptyCell);
  resolveBorderConflict(emptyCell,true);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.indexOf(leftSideCellArea);
    row.addChild(index + 1,emptyCell);
  }
 else {
    row.addChild(0,emptyCell);
  }
  emptyCell.isDummy=true;
  return emptyCell;
}

Fixed version (ground truth):
private CellArea createEmptyCell(CellArea upperCell,int columnId,RowArea row){
  ICellContent cellContent=null;
  int rowSpan=1;
  if (upperCell != null) {
    cellContent=(ICellContent)upperCell.getContent();
    rowSpan=upperCell.getRowSpan() - 1;
  }
  if (cellContent == null) {
    cellContent=tableContent.getReportContent().createCellContent();
    cellContent.setColumn(columnId);
    cellContent.setColSpan(1);
    cellContent.setRowSpan(1);
    cellContent.setParent(row.getContent());
  }
  int emptyCellColID=cellContent.getColumn();
  int emptyCellColSpan=cellContent.getColSpan();
  CellArea emptyCell=null;
  if (upperCell != null) {
    emptyCell=upperCell.cloneArea();
  }
 else {
    emptyCell=new CellArea();
    emptyCell.content=cellContent;
  }
  BoxStyle bs=emptyCell.getBoxStyle();
  if (bs != BoxStyle.DEFAULT) {
    bs.setRightBorder(null);
    bs.setBottomBorder(null);
  }
  emptyCell.setHeight(0);
  emptyCell.setRowSpan(rowSpan);
  CellArea originalCell=upperCell;
  if (upperCell instanceof DummyCell) {
    originalCell=((DummyCell)upperCell).getCell();
  }
  CellArea leftSideCellArea=null;
  if (emptyCellColID > startCol) {
    leftSideCellArea=row.getCell(emptyCellColID - 1);
    if (leftSideCellArea == null) {
      int k=emptyCellColID - 1;
      while (leftSideCellArea == null && k > startCol) {
        k--;
        leftSideCellArea=row.getCell(k);
      }
    }
  }
 else {
    leftSideCellArea=null;
  }
  emptyCell.setParent(row);
  row.setCell(emptyCell);
  resolveBorderConflict(emptyCell,true);
  emptyCell.setWidth(getCellWidth(emptyCellColID,emptyCellColID + emptyCellColSpan));
  emptyCell.setPosition(layoutInfo.getXPosition(columnId),0);
  if (leftSideCellArea != null) {
    int index=row.indexOf(leftSideCellArea);
    row.addChild(index + 1,emptyCell);
  }
 else {
    row.addChild(0,emptyCell);
  }
  emptyCell.isDummy=true;
  return emptyCell;
}