Program: 76332
Project: 76332
Buggy source:
public CrosstabCellAdapter createCrosstabCellAdapter(String type,CrosstabCellHandle handle,int rowNumber,int rowSpan,int columnNumber,int columnSpan,boolean isConvert){
  CrosstabCellAdapter retValue=null;
  if (CELL_LEVEL_HANDLE.equals(type) || CELL_FIRST_LEVEL_HANDLE.equals(type) || CELL_MEASURE.equals(type)) {
    retValue=new NormalCrosstabCellAdapter(handle);
  }
 else   if (CELL_MEASURE_HEADER.equals(type)) {
    retValue=new HeaderCrosstabCellHandleAdapter(handle);
  }
 else   if (CELL_ROW_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.ROW_TYPE);
  }
 else   if (CELL_COLUMN_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.COLUMN_TYPE);
  }
 else   if (CELL_MEASURE_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.MEASURE_TYPE);
  }
 else   if (LEFT_CONNER.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.IMMACULATE_TYPE);
  }
 else   if (CELL_SUB_TOTAL.equals(type)) {
    retValue=new TotalCrosstabCellHandleAdapter(handle);
    ((TotalCrosstabCellHandleAdapter)retValue).setType(TotalCrosstabCellHandleAdapter.SUB_TOTAL);
  }
 else   if (CELL_GRAND_TOTAL.equals(type)) {
    retValue=new TotalCrosstabCellHandleAdapter(handle);
    ((TotalCrosstabCellHandleAdapter)retValue).setType(TotalCrosstabCellHandleAdapter.GRAND_TOTAL);
  }
 else   if (CELL_MEASURE_AGGREGATION.equals(type)) {
    retValue=new AggregationCrosstabCellAdapter((AggregationCellHandle)handle);
  }
  if (retValue == null) {
    return retValue;
  }
  if (isConvert) {
    int temp=rowNumber;
    rowNumber=columnNumber;
    columnNumber=temp;
    temp=rowSpan;
    rowSpan=columnSpan;
    columnSpan=temp;
  }
  if (rowNumber >= 1) {
    retValue.setRowNumber(rowNumber);
  }
  if (rowSpan >= 1) {
    retValue.setRowSpan(rowSpan);
  }
  if (columnNumber >= 1) {
    retValue.setColumnNumber(columnNumber);
  }
  if (columnSpan >= 1) {
    retValue.setColumnSpan(columnSpan);
  }
  retValue.setPositionType(type);
  return retValue;
}

Fixed version (ground truth):
public CrosstabCellAdapter createCrosstabCellAdapter(String type,CrosstabCellHandle handle,int rowNumber,int rowSpan,int columnNumber,int columnSpan,boolean isConvert){
  CrosstabCellAdapter retValue=null;
  if (CELL_LEVEL_HANDLE.equals(type) || CELL_FIRST_LEVEL_HANDLE.equals(type) || CELL_MEASURE.equals(type)) {
    retValue=new NormalCrosstabCellAdapter(handle);
  }
 else   if (CELL_MEASURE_HEADER.equals(type)) {
    retValue=new HeaderCrosstabCellHandleAdapter(handle);
  }
 else   if (CELL_ROW_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setCrosstabReportItemHandle(getCrosstabReportItemHandle());
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.ROW_TYPE);
  }
 else   if (CELL_COLUMN_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setCrosstabReportItemHandle(getCrosstabReportItemHandle());
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.COLUMN_TYPE);
  }
 else   if (CELL_MEASURE_VIRTUAL.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setCrosstabReportItemHandle(getCrosstabReportItemHandle());
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.MEASURE_TYPE);
  }
 else   if (LEFT_CONNER.equals(type)) {
    retValue=new VirtualCrosstabCellAdapter(handle);
    ((VirtualCrosstabCellAdapter)retValue).setCrosstabReportItemHandle(getCrosstabReportItemHandle());
    ((VirtualCrosstabCellAdapter)retValue).setType(VirtualCrosstabCellAdapter.IMMACULATE_TYPE);
  }
 else   if (CELL_SUB_TOTAL.equals(type)) {
    retValue=new TotalCrosstabCellHandleAdapter(handle);
    ((TotalCrosstabCellHandleAdapter)retValue).setType(TotalCrosstabCellHandleAdapter.SUB_TOTAL);
  }
 else   if (CELL_GRAND_TOTAL.equals(type)) {
    retValue=new TotalCrosstabCellHandleAdapter(handle);
    ((TotalCrosstabCellHandleAdapter)retValue).setType(TotalCrosstabCellHandleAdapter.GRAND_TOTAL);
  }
 else   if (CELL_MEASURE_AGGREGATION.equals(type)) {
    retValue=new AggregationCrosstabCellAdapter((AggregationCellHandle)handle);
  }
  if (retValue == null) {
    return retValue;
  }
  if (isConvert) {
    int temp=rowNumber;
    rowNumber=columnNumber;
    columnNumber=temp;
    temp=rowSpan;
    rowSpan=columnSpan;
    columnSpan=temp;
  }
  if (rowNumber >= 1) {
    retValue.setRowNumber(rowNumber);
  }
  if (rowSpan >= 1) {
    retValue.setRowSpan(rowSpan);
  }
  if (columnNumber >= 1) {
    retValue.setColumnNumber(columnNumber);
  }
  if (columnSpan >= 1) {
    retValue.setColumnSpan(columnSpan);
  }
  retValue.setPositionType(type);
  return retValue;
}