Program: 77326
Project: 77326
Buggy source:
/** 
 * resolve cell border conflict
 * @param cellArea
 */
public void resolveBorderConflict(CellArea cellArea){
  IContent cellContent=cellArea.getContent();
  int columnID=cellArea.getColumnID();
  int rowID=cellArea.getRowID();
  int colSpan=cellArea.getColSpan();
  IRowContent row=(IRowContent)cellContent.getParent();
  IStyle cellContentStyle=cellContent.getComputedStyle();
  IStyle cellAreaStyle=cellArea.getStyle();
  IStyle tableStyle=tableContent.getComputedStyle();
  IStyle rowStyle=row.getComputedStyle();
  IStyle columnStyle=getColumnStyle(columnID);
  IStyle preRowStyle=null;
  IStyle preColumnStyle=getColumnStyle(columnID - 1);
  IStyle leftCellContentStyle=null;
  IStyle topCellStyle=null;
  if (rowID == currentRowID - 1) {
    if (columnID > 0 && currentRowContent[columnID - 1] != null) {
      leftCellContentStyle=currentRowContent[columnID - 1].cell.getComputedStyle();
    }
    if (lastRow != null) {
      if (rowCount > 1) {
        preRowStyle=lastRow.row.getComputedStyle();
        if (lastRowContent[columnID] != null) {
          topCellStyle=lastRowContent[columnID].cell.getComputedStyle();
        }
      }
 else {
        if (root.getChildrenCount() > 0 && lastRowArea != null) {
          preRowStyle=lastRowArea.getContent().getComputedStyle();
          Iterator iter=lastRowArea.getChildren();
          while (iter.hasNext()) {
            CellArea cell=(CellArea)iter.next();
            ICellContent cc=(ICellContent)cell.getContent();
            if (cc != null && cc.getColumn() == columnID) {
              topCellStyle=cc.getComputedStyle();
              break;
            }
          }
        }
      }
    }
  }
  if (rowID == 0) {
    if (tablepaginated) {
      bcr.resolvePagenatedTableTopBorder(rowStyle,cellContentStyle,cellAreaStyle);
      tablepaginated=false;
    }
 else {
      bcr.resolveTableTopBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID == 0) {
      bcr.resolveTableLeftBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellLeftBorder(preColumnStyle,columnStyle,leftCellContentStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID + colSpan == columnNumber) {
      bcr.resolveTableRightBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
  }
 else {
    if (tablepaginated) {
      bcr.resolvePagenatedTableTopBorder(rowStyle,cellContentStyle,cellAreaStyle);
      tablepaginated=false;
    }
 else {
      bcr.resolveCellTopBorder(preRowStyle,rowStyle,topCellStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID == 0) {
      bcr.resolveTableLeftBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellLeftBorder(preColumnStyle,columnStyle,leftCellContentStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID + colSpan == columnNumber) {
      bcr.resolveTableRightBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
  }
}

Fixed version (ground truth):
/** 
 * resolve cell border conflict
 * @param cellArea
 */
public void resolveBorderConflict(CellArea cellArea){
  IContent cellContent=cellArea.getContent();
  int columnID=cellArea.getColumnID();
  int rowID=cellArea.getRowID();
  int colSpan=cellArea.getColSpan();
  IRowContent row=(IRowContent)cellContent.getParent();
  IStyle cellContentStyle=cellContent.getComputedStyle();
  IStyle cellAreaStyle=cellArea.getStyle();
  IStyle tableStyle=tableContent.getComputedStyle();
  IStyle rowStyle=row.getComputedStyle();
  IStyle columnStyle=getColumnStyle(columnID);
  IStyle preRowStyle=null;
  IStyle preColumnStyle=getColumnStyle(columnID - 1);
  IStyle leftCellContentStyle=null;
  IStyle topCellStyle=null;
  if (columnID > 0 && currentRowContent[columnID - 1] != null) {
    leftCellContentStyle=currentRowContent[columnID - 1].cell.getComputedStyle();
  }
  if (rowCount > 1 && lastRow != null) {
    preRowStyle=lastRow.row.getComputedStyle();
    if (lastRowContent[columnID] != null) {
      topCellStyle=lastRowContent[columnID].cell.getComputedStyle();
    }
  }
 else {
    if (lastRowArea != null) {
      preRowStyle=lastRowArea.getContent().getComputedStyle();
      Iterator iter=lastRowArea.getChildren();
      while (iter.hasNext()) {
        CellArea cell=(CellArea)iter.next();
        ICellContent cc=(ICellContent)cell.getContent();
        if (cc != null && cc.getColumn() == columnID) {
          topCellStyle=cc.getComputedStyle();
          break;
        }
      }
    }
  }
  if (rowID == 0) {
    if (tablepaginated) {
      bcr.resolvePagenatedTableTopBorder(rowStyle,cellContentStyle,cellAreaStyle);
      tablepaginated=false;
    }
 else {
      bcr.resolveTableTopBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID == 0) {
      bcr.resolveTableLeftBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellLeftBorder(preColumnStyle,columnStyle,leftCellContentStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID + colSpan == columnNumber) {
      bcr.resolveTableRightBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
  }
 else {
    bcr.resolveCellTopBorder(preRowStyle,rowStyle,topCellStyle,cellContentStyle,cellAreaStyle);
    if (columnID == 0) {
      bcr.resolveTableLeftBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellLeftBorder(preColumnStyle,columnStyle,leftCellContentStyle,cellContentStyle,cellAreaStyle);
    }
    if (columnID + colSpan == columnNumber) {
      bcr.resolveTableRightBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
  }
}