Program: 72170
Project: 72170
Buggy source:
protected void verticalAlign(CellArea c){
  CellArea cell;
  if (c instanceof DummyCell) {
    cell=((DummyCell)c).getCell();
  }
 else {
    cell=c;
  }
  IContent content=cell.getContent();
  if (content == null) {
    return;
  }
  CSSValue verticalAlign=content.getComputedStyle().getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  if (IStyle.BOTTOM_VALUE.equals(verticalAlign) || IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
    int totalHeight=0;
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      totalHeight+=child.getAllocatedHeight();
    }
    int offset=cell.getContentHeight() - totalHeight;
    if (offset > 0) {
      if (IStyle.BOTTOM_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset);
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset / 2);
        }
      }
    }
  }
  CSSValue align=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  if ((IStyle.RIGHT_VALUE.equals(align) || IStyle.CENTER_VALUE.equals(align))) {
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      int spacing=cell.getContentWidth() - area.getAllocatedWidth();
      if (spacing > 0) {
        if (IStyle.RIGHT_VALUE.equals(align)) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(CellArea c){
  CellArea cell;
  if (c instanceof DummyCell) {
    cell=((DummyCell)c).getCell();
  }
 else {
    cell=c;
  }
  IContent content=cell.getContent();
  if (content == null) {
    return;
  }
  CSSValue verticalAlign=content.getComputedStyle().getProperty(IStyle.STYLE_VERTICAL_ALIGN);
  if (IStyle.BOTTOM_VALUE.equals(verticalAlign) || IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
    int totalHeight=0;
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea child=(AbstractArea)iter.next();
      totalHeight+=child.getAllocatedHeight();
    }
    int offset=cell.getContentHeight() - totalHeight;
    if (offset > 0) {
      if (IStyle.BOTTOM_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset);
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedPosition(child.getAllocatedX(),child.getAllocatedY() + offset / 2);
        }
      }
    }
  }
  CSSValue align=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  boolean isRightAligned=IStyle.RIGHT_VALUE.equals(align) || IStyle.JUSTIFY_VALUE.equals(align) && content.isRTL();
  if ((isRightAligned || IStyle.CENTER_VALUE.equals(align))) {
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      int spacing=cell.getContentWidth() - area.getAllocatedWidth();
      if (spacing > 0) {
        if (isRightAligned) {
          area.setAllocatedPosition(spacing + area.getAllocatedX(),area.getAllocatedY());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setAllocatedPosition(spacing / 2 + area.getAllocatedX(),area.getAllocatedY());
        }
      }
    }
  }
}