Program: 74846
Project: 74846
Buggy source:
public void resolveDropCells(int dropValue){
  assert(dropValue < 0);
  if (rows.size() == 0 || !hasDropCell) {
    return;
  }
  Row row=(Row)rows.getCurrent();
  assert(row != null);
  int rowHeight=row.getArea().getHeight();
  int height=rowHeight;
  boolean needResolve=false;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell != null && cell.getRowSpan() == dropValue) {
      height=Math.max(height,cell.getHeight());
      needResolve=true;
    }
  }
  if (needResolve) {
    HashSet dropCells=new HashSet();
    int delta=height - rowHeight;
    for (int i=startCol; i <= endCol; i++) {
      CellArea cell=row.getCell(i);
      if (cell == null) {
        continue;
      }
      if (cell.getRowSpan() == dropValue) {
        if (cell instanceof DummyCell) {
          CellArea ref=((DummyCell)cell).getCell();
          int cellHeight=cell.getHeight();
          int refHeight=ref.getHeight();
          if (!dropCells.contains(ref)) {
            ref.setHeight(refHeight - cellHeight + delta);
            verticalAlign(ref);
            dropCells.add(ref);
          }
        }
 else {
          cell.setHeight(height);
          verticalAlign(cell);
        }
        cell.setRowSpan(1);
      }
 else       if (cell.getRowSpan() == 1) {
        if (cell instanceof DummyCell) {
          CellArea ref=((DummyCell)cell).getCell();
          if (!dropCells.contains(ref)) {
            ref.setHeight(ref.getHeight() + delta);
            if (delta > 0) {
              verticalAlign(ref);
            }
            dropCells.add(ref);
          }
        }
 else {
          cell.setHeight(height);
          verticalAlign(cell);
        }
      }
    }
  }
}

Fixed version (ground truth):
public int resolveDropCells(int dropValue){
  assert(dropValue < 0);
  if (rows.size() == 0 || !hasDropCell) {
    return 0;
  }
  Row row=(Row)rows.getCurrent();
  assert(row != null);
  int rowHeight=row.getArea().getHeight();
  int height=rowHeight;
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell == null)     continue;
    if (cell.getRowSpan() == dropValue) {
      if (cell instanceof DummyCell) {
        height=Math.max(height,cell.getHeight() + rowHeight);
      }
 else {
        height=Math.max(height,cell.getHeight());
      }
    }
  }
  int delta=height - rowHeight;
  HashSet dropCells=new HashSet();
  for (int i=startCol; i <= endCol; i++) {
    CellArea cell=row.getCell(i);
    if (cell == null)     continue;
    if (cell instanceof DummyCell) {
      int remainCellHeight=cell.getHeight() - delta;
      cell.setHeight(remainCellHeight);
      if (cell.getRowSpan() == dropValue) {
        if (cell.getHeight() < 0) {
          CellArea ref=((DummyCell)cell).getCell();
          if (!dropCells.contains(ref)) {
            ref.setHeight(ref.getHeight() - remainCellHeight);
            cell.setHeight(0);
            verticalAlign(ref);
            dropCells.add(ref);
          }
        }
        cell.setRowSpan(1);
      }
    }
 else     if ((cell.getRowSpan() == 1)) {
      if (delta != 0) {
        cell.setHeight(height);
        row.getArea().setHeight(height);
        verticalAlign(cell);
      }
    }
  }
  return delta;
}