Program: 70260
Project: 70260
Buggy source:
protected void verticalAlign(CellArea cell){
  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+=getAllocatedHeight(child);
    }
    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.setPosition(child.getX(),child.getY() + offset);
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setPosition(child.getX(),child.getY() + offset / 2);
        }
      }
    }
  }
  CSSValue align=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  boolean isRightAligned=BidiAlignmentResolver.isRightAligned(content,align,false);
  if (isRightAligned || IStyle.CENTER_VALUE.equals(align)) {
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      int spacing=cell.getContentWidth() - getAllocatedWidth(area);
      if (spacing > 0) {
        if (isRightAligned) {
          area.setPosition(spacing + area.getX(),area.getY());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setPosition(spacing / 2 + area.getX(),area.getY());
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void verticalAlign(CellArea cell){
  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+=getAllocatedHeight(child);
    }
    int offset=cell.getContentHeight() - totalHeight;
    if (offset > 0) {
      if (IStyle.BOTTOM_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        int y=cell.getOffsetY() + offset;
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedY(y);
          y+=child.getAllocatedHeight();
        }
      }
 else       if (IStyle.MIDDLE_VALUE.equals(verticalAlign)) {
        iter=cell.getChildren();
        int y=cell.getOffsetY() + offset / 2;
        while (iter.hasNext()) {
          AbstractArea child=(AbstractArea)iter.next();
          child.setAllocatedY(y);
          y+=child.getAllocatedHeight();
        }
      }
    }
  }
  CSSValue align=content.getComputedStyle().getProperty(IStyle.STYLE_TEXT_ALIGN);
  boolean isRightAligned=BidiAlignmentResolver.isRightAligned(content,align,false);
  if (isRightAligned || IStyle.CENTER_VALUE.equals(align)) {
    Iterator iter=cell.getChildren();
    while (iter.hasNext()) {
      AbstractArea area=(AbstractArea)iter.next();
      int spacing=cell.getContentWidth() - getAllocatedWidth(area);
      if (spacing > 0) {
        if (isRightAligned) {
          area.setAllocatedX(spacing + cell.getOffsetX());
        }
 else         if (IStyle.CENTER_VALUE.equals(align)) {
          area.setAllocatedX(spacing / 2 + cell.getOffsetX());
        }
      }
    }
  }
}