Program: 72997
Project: 72997
Buggy source:
/** 
 * Adds Axis chart in XTab
 * @param cell
 * @param bTransposed
 * @param chartHandle
 * @throws BirtException
 */
public static void addAxisChartInXTab(AggregationCellHandle cell,boolean bTransposed,ExtendedItemHandle hostChartHandle) throws BirtException {
  int axisType=bTransposed ? ICrosstabConstants.ROW_AXIS_TYPE : ICrosstabConstants.COLUMN_AXIS_TYPE;
  if (bTransposed) {
    cell.setSpanOverOnRow(cell.getAggregationOnRow());
    cell.setSpanOverOnColumn(null);
    CrosstabCellHandle rowCell=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.ROW_AXIS_TYPE);
    if (rowCell == null) {
      return;
    }
    if (rowCell.getHeight() == null || rowCell.getHeight().getMeasure() == 0) {
      cell.getCrosstab().setRowHeight(rowCell,DEFAULT_ROW_WIDTH);
    }
    rowCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_TOP_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
    rowCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_BOTTOM_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
  }
 else {
    cell.setSpanOverOnColumn(cell.getAggregationOnColumn());
    cell.setSpanOverOnRow(null);
    CrosstabCellHandle columnCell=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.COLUMN_AXIS_TYPE);
    if (columnCell == null) {
      return;
    }
    if (columnCell.getWidth() != null || columnCell.getWidth().getMeasure() == 0) {
      cell.getCrosstab().setColumnWidth(columnCell,DEFAULT_COLUMN_WIDTH);
    }
    columnCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_LEFT_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
    columnCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_RIGHT_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
  }
  boolean bNewGrandTotol=false;
  if (cell.getCrosstab().getGrandTotal(axisType) == null) {
    bNewGrandTotol=true;
    cell.getCrosstab().addGrandTotal(axisType);
  }
  ExtendedItemHandle axisChartHandle=createChartHandle(cell.getModelHandle(),ChartReportItemConstants.TYPE_AXIS_CHART,hostChartHandle);
  AggregationCellHandle grandTotalAggCell;
  if (bTransposed) {
    grandTotalAggCell=((MeasureViewHandle)cell.getContainer()).getAggregationCell(null,null,cell.getDimensionName(ICrosstabConstants.COLUMN_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.COLUMN_AXIS_TYPE));
  }
 else {
    grandTotalAggCell=((MeasureViewHandle)cell.getContainer()).getAggregationCell(cell.getDimensionName(ICrosstabConstants.ROW_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.ROW_AXIS_TYPE),null,null);
  }
  if (bNewGrandTotol) {
    Object content=ChartXTabUtil.getFirstContent(grandTotalAggCell);
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
  }
  if (grandTotalAggCell != null) {
    grandTotalAggCell.addContent(axisChartHandle,0);
  }
}

Fixed version (ground truth):
/** 
 * Adds Axis chart in XTab
 * @param cell
 * @param bTransposed
 * @param chartHandle
 * @throws BirtException
 */
public static void addAxisChartInXTab(AggregationCellHandle cell,boolean bTransposed,ExtendedItemHandle hostChartHandle) throws BirtException {
  int axisType=getXTabAxisType(bTransposed);
  if (bTransposed) {
    cell.setSpanOverOnRow(cell.getAggregationOnRow());
    cell.setSpanOverOnColumn(null);
    CrosstabCellHandle rowCell=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.ROW_AXIS_TYPE);
    if (rowCell == null) {
      return;
    }
    if (rowCell.getHeight() == null || rowCell.getHeight().getMeasure() == 0) {
      cell.getCrosstab().setRowHeight(rowCell,DEFAULT_ROW_WIDTH);
    }
    rowCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_TOP_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
    rowCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_BOTTOM_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
  }
 else {
    cell.setSpanOverOnColumn(cell.getAggregationOnColumn());
    cell.setSpanOverOnRow(null);
    CrosstabCellHandle columnCell=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.COLUMN_AXIS_TYPE);
    if (columnCell == null) {
      return;
    }
    if (columnCell.getWidth() != null || columnCell.getWidth().getMeasure() == 0) {
      cell.getCrosstab().setColumnWidth(columnCell,DEFAULT_COLUMN_WIDTH);
    }
    columnCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_LEFT_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
    columnCell.getCrosstabHandle().setProperty(StyleHandle.PADDING_RIGHT_PROP,new DimensionValue(0,DesignChoiceConstants.UNITS_PT));
  }
  boolean bNewGrandTotol=false;
  if (cell.getCrosstab().getGrandTotal(axisType) == null) {
    bNewGrandTotol=true;
    cell.getCrosstab().addGrandTotal(axisType);
  }
  ExtendedItemHandle axisChartHandle=createChartHandle(cell.getModelHandle(),ChartReportItemConstants.TYPE_AXIS_CHART,hostChartHandle);
  AggregationCellHandle grandTotalAggCell;
  if (bTransposed) {
    grandTotalAggCell=((MeasureViewHandle)cell.getContainer()).getAggregationCell(null,null,cell.getDimensionName(ICrosstabConstants.COLUMN_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.COLUMN_AXIS_TYPE));
  }
 else {
    grandTotalAggCell=((MeasureViewHandle)cell.getContainer()).getAggregationCell(cell.getDimensionName(ICrosstabConstants.ROW_AXIS_TYPE),cell.getLevelName(ICrosstabConstants.ROW_AXIS_TYPE),null,null);
  }
  if (bNewGrandTotol) {
    Object content=ChartXTabUtil.getFirstContent(grandTotalAggCell);
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
  }
  if (grandTotalAggCell != null) {
    grandTotalAggCell.addContent(axisChartHandle,0);
  }
}