Program: 77708
Project: 77708
Buggy source:
/** 
 * update row height
 * @param row
 */
public void updateRow(RowArea row,int specifiedHeight){
  ArrayList dropCells=this.dropList;
  CellWrapper[] cells=currentRowContent;
  Iterator iter=row.getChildren();
  int height=specifiedHeight;
  boolean[] hasCell=new boolean[columnNumber];
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    height=Math.max(height,cell.getHeight());
    int colID=cell.getColumnID();
    for (int i=colID; i < cell.getColumnID() + cell.getColSpan(); i++) {
      hasCell[i]=true;
    }
    if (cells[colID] != null && (cells[colID].rowSpan != 1)) {
      dropCells.add(new DropCellInfo(cell,cells[colID].rowSpan));
    }
  }
  Iterator iterator=dropCells.iterator();
  while (iterator.hasNext()) {
    DropCellInfo dropCell=(DropCellInfo)iterator.next();
    for (int i=dropCell.cell.getColumnID(); i < dropCell.cell.getColumnID() + dropCell.cell.getColSpan(); i++) {
      hasCell[i]=true;
    }
  }
  if (height > 0) {
    for (int i=0; i < dropCells.size(); i++) {
      DropCellInfo dropCell=(DropCellInfo)dropCells.get(i);
      dropCell.leftHeight-=height;
      if (dropCell.leftHeight <= 0) {
        dropCell.cell.setHeight(dropCell.cell.getHeight() - dropCell.leftHeight);
        dropCell.leftHeight=0;
      }
    }
    for (int i=0; i < columnNumber; i++) {
      if (!hasCell[i]) {
        ICellContent cellContent=null;
        if (cells[i] != null) {
          cellContent=cells[i].cell;
        }
        if (cellContent == null) {
          cellContent=tableContent.getReportContent().createCellContent();
          cellContent.setColumn(i);
          cellContent.setColSpan(1);
          cellContent.setRowSpan(1);
          cellContent.setParent(currentRow.row);
        }
        int startColumn=cellContent.getColumn();
        int endColumn=cellContent.getColSpan() + startColumn;
        CellArea emptyCell=AreaFactory.createCellArea(cellContent);
        resolveBorderConflict(emptyCell);
        IStyle style=emptyCell.getStyle();
        emptyCell.setWidth(getCellWidth(startColumn,endColumn));
        emptyCell.setPosition(layoutInfo.getXPosition(i),0);
        row.addChild(emptyCell);
        emptyCell.setHeight(height);
        for (int j=startColumn; j < endColumn; j++) {
          hasCell[j]=true;
        }
        if (cells[i] != null) {
          if (cells[i].rowSpan != 1) {
            dropList.add(new DropCellInfo(emptyCell,0,cells[i].rowSpan));
          }
        }
      }
    }
    iter=row.getChildren();
    while (iter.hasNext()) {
      CellArea cell=(CellArea)iter.next();
      if (cell.getRowSpan() == 1) {
        cell.setHeight(height);
        verticalAlign(cell);
      }
    }
    row.setHeight(height);
  }
}

Fixed version (ground truth):
/** 
 * update row height
 * @param row
 */
public void updateRow(RowArea row,int specifiedHeight){
  ArrayList dropCells=this.dropList;
  CellWrapper[] cells=currentRowContent;
  Iterator iter=row.getChildren();
  int height=specifiedHeight;
  boolean[] hasCell=new boolean[columnNumber];
  while (iter.hasNext()) {
    CellArea cell=(CellArea)iter.next();
    int colID=cell.getColumnID();
    if (currentRowContent[colID] != null && currentRowContent[colID].rowSpan == 1) {
      height=Math.max(height,cell.getHeight());
    }
    for (int i=colID; i < cell.getColumnID() + cell.getColSpan(); i++) {
      hasCell[i]=true;
    }
    if (cells[colID] != null && (cells[colID].rowSpan != 1)) {
      dropCells.add(new DropCellInfo(cell,cells[colID].rowSpan));
    }
  }
  Iterator iterator=dropCells.iterator();
  while (iterator.hasNext()) {
    DropCellInfo dropCell=(DropCellInfo)iterator.next();
    for (int i=dropCell.cell.getColumnID(); i < dropCell.cell.getColumnID() + dropCell.cell.getColSpan(); i++) {
      hasCell[i]=true;
    }
  }
  if (height > 0) {
    for (int i=0; i < dropCells.size(); i++) {
      DropCellInfo dropCell=(DropCellInfo)dropCells.get(i);
      dropCell.leftHeight-=height;
      if (dropCell.leftHeight <= 0) {
        dropCell.cell.setHeight(dropCell.cell.getHeight() - dropCell.leftHeight);
        dropCell.leftHeight=0;
      }
    }
    for (int i=0; i < columnNumber; i++) {
      if (!hasCell[i]) {
        ICellContent cellContent=null;
        if (cells[i] != null) {
          cellContent=cells[i].cell;
        }
        if (cellContent == null) {
          cellContent=tableContent.getReportContent().createCellContent();
          cellContent.setColumn(i);
          cellContent.setColSpan(1);
          cellContent.setRowSpan(1);
          cellContent.setParent(currentRow.row);
        }
        int startColumn=cellContent.getColumn();
        int endColumn=cellContent.getColSpan() + startColumn;
        CellArea emptyCell=AreaFactory.createCellArea(cellContent);
        resolveBorderConflict(emptyCell);
        IStyle style=emptyCell.getStyle();
        emptyCell.setWidth(getCellWidth(startColumn,endColumn));
        emptyCell.setPosition(layoutInfo.getXPosition(i),0);
        row.addChild(emptyCell);
        emptyCell.setHeight(height);
        for (int j=startColumn; j < endColumn; j++) {
          hasCell[j]=true;
        }
        if (cells[i] != null) {
          if (cells[i].rowSpan != 1) {
            dropList.add(new DropCellInfo(emptyCell,0,cells[i].rowSpan));
          }
        }
      }
    }
    iter=row.getChildren();
    while (iter.hasNext()) {
      CellArea cell=(CellArea)iter.next();
      int colID=cell.getColumnID();
      if (currentRowContent[colID] != null && currentRowContent[colID].rowSpan == 1) {
        cell.setHeight(height);
        verticalAlign(cell);
      }
    }
    row.setHeight(height);
  }
}