Program: 75243
Project: 75243
Buggy source:
/** 
 * resolve cell border conflict
 * @param cellArea
 */
public void resolveBorderConflict(CellArea cellArea,boolean isFirst){
  IContent cellContent=cellArea.getContent();
  int columnID=cellArea.getColumnID();
  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 (lastCellContent != null && lastCellContent.getColumn() < columnID) {
    leftCellContentStyle=lastCellContent.getComputedStyle();
  }
  Row lastRow=null;
  if (rows.size() > 0) {
    lastRow=(Row)rows.getCurrent();
  }
  if (lastRow != null) {
    preRowStyle=lastRow.getContent().getComputedStyle();
    CellArea cell=lastRow.getCell(columnID);
    if (cell != null && cell.getContent() != null) {
      topCellStyle=cell.getContent().getComputedStyle();
    }
  }
  if (rows.size() == 0 && lastRow == null) {
    if (isFirst) {
      bcr.resolveTableTopBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveTableTopBorder(tableStyle,null,columnStyle,null,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 (isFirst) {
      bcr.resolveCellTopBorder(preRowStyle,rowStyle,topCellStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellTopBorder(preRowStyle,null,topCellStyle,null,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);
    }
  }
  lastCellContent=(ICellContent)cellContent;
}

Fixed version (ground truth):
/** 
 * resolve cell border conflict
 * @param cellArea
 */
public void resolveBorderConflict(CellArea cellArea,boolean isFirst){
  IContent cellContent=cellArea.getContent();
  int columnID=cellArea.getColumnID();
  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;
  Row lastRow=null;
  if (rows.size() > 0) {
    lastRow=(Row)rows.getCurrent();
  }
  leftCellContentStyle=getLeftCellContentStyle(lastRow,columnID);
  if (lastRow != null) {
    preRowStyle=lastRow.getContent().getComputedStyle();
    CellArea cell=lastRow.getCell(columnID);
    if (cell != null && cell.getContent() != null) {
      topCellStyle=cell.getContent().getComputedStyle();
    }
  }
  if (rows.size() == 0 && lastRow == null) {
    if (isFirst) {
      bcr.resolveTableTopBorder(tableStyle,rowStyle,columnStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveTableTopBorder(tableStyle,null,columnStyle,null,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 (isFirst) {
      bcr.resolveCellTopBorder(preRowStyle,rowStyle,topCellStyle,cellContentStyle,cellAreaStyle);
    }
 else {
      bcr.resolveCellTopBorder(preRowStyle,null,topCellStyle,null,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);
    }
  }
  lastCellContent=(ICellContent)cellContent;
}