Program: 68796
Project: 68796
Buggy source:
private void handleBorderInRow(TableBorder tb,RowArea row,int offsetX,int offsetY){
  for (Iterator ri=row.getChildren(); ri.hasNext(); ) {
    IArea area=(IArea)ri.next();
    if (!(area instanceof CellArea)) {
      continue;
    }
    CellArea cell=(CellArea)area;
    BorderInfo[] borders=cacheCellBorder(cell);
    int cellX=offsetX + cell.getX();
    int cellY=offsetY + cell.getY();
    int cellRx=cellX + cell.getWidth();
    int cellBy=cellY + cell.getHeight();
    tb.addColumn(cellRx);
    tb.addRow(cellBy);
    if (null != borders && borders[BorderInfo.TOP_BORDER].borderWidth != 0) {
      tb.setRowBorder(cellY,cellX,cellRx,borders[BorderInfo.TOP_BORDER].borderStyle,borders[BorderInfo.TOP_BORDER].borderWidth,borders[BorderInfo.TOP_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.LEFT_BORDER].borderWidth != 0) {
      tb.setColumnBorder(cellX,cellY,cellBy,borders[BorderInfo.LEFT_BORDER].borderStyle,borders[BorderInfo.LEFT_BORDER].borderWidth,borders[BorderInfo.LEFT_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.BOTTOM_BORDER].borderWidth != 0) {
      tb.setRowBorder(cellBy,cellX,cellRx,borders[BorderInfo.BOTTOM_BORDER].borderStyle,borders[BorderInfo.BOTTOM_BORDER].borderWidth,borders[BorderInfo.BOTTOM_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.RIGHT_BORDER].borderWidth != 0) {
      tb.setColumnBorder(cellRx,cellY,cellBy,borders[BorderInfo.RIGHT_BORDER].borderStyle,borders[BorderInfo.RIGHT_BORDER].borderWidth,borders[BorderInfo.RIGHT_BORDER].borderColor);
    }
  }
}

Fixed version (ground truth):
private void handleBorderInRow(TableBorder tb,RowArea row,int offsetX,int offsetY){
  for (Iterator ri=row.getChildren(); ri.hasNext(); ) {
    IArea area=(IArea)ri.next();
    if (!(area instanceof CellArea)) {
      continue;
    }
    CellArea cell=(CellArea)area;
    BorderInfo[] borders=cacheCellBorder(cell);
    int cellX=offsetX + cell.getX();
    int cellY=offsetY + cell.getY();
    int cellRx=cellX + cell.getWidth();
    int cellBy=cellY + cell.getHeight();
    tb.addColumn(cellX);
    tb.addColumn(cellRx);
    tb.addRow(cellBy);
    if (null != borders && borders[BorderInfo.TOP_BORDER].borderWidth != 0) {
      tb.setRowBorder(cellY,cellX,cellRx,borders[BorderInfo.TOP_BORDER].borderStyle,borders[BorderInfo.TOP_BORDER].borderWidth,borders[BorderInfo.TOP_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.LEFT_BORDER].borderWidth != 0) {
      tb.setColumnBorder(cellX,cellY,cellBy,borders[BorderInfo.LEFT_BORDER].borderStyle,borders[BorderInfo.LEFT_BORDER].borderWidth,borders[BorderInfo.LEFT_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.BOTTOM_BORDER].borderWidth != 0) {
      tb.setRowBorder(cellBy,cellX,cellRx,borders[BorderInfo.BOTTOM_BORDER].borderStyle,borders[BorderInfo.BOTTOM_BORDER].borderWidth,borders[BorderInfo.BOTTOM_BORDER].borderColor);
    }
    if (null != borders && borders[BorderInfo.RIGHT_BORDER].borderWidth != 0) {
      tb.setColumnBorder(cellRx,cellY,cellBy,borders[BorderInfo.RIGHT_BORDER].borderStyle,borders[BorderInfo.RIGHT_BORDER].borderWidth,borders[BorderInfo.RIGHT_BORDER].borderColor);
    }
  }
}