Program: 73640
Project: 73640
Buggy source:
public void switchView(AggregationCellHandle cell){
  try {
    String exprMeasure=null;
    Object content=getFirstContent(cell);
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      exprMeasure=dataItemHandle.getResultSetColumn();
    }
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
    String exprDimRow=null;
    content=getFirstContent(getLevelCell(cell.getCrosstab().getCrosstabView(ICrosstabConstants.ROW_AXIS_TYPE)));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      exprDimRow=dataItemHandle.getResultSetColumn();
    }
    String exprDimColumn=null;
    content=getFirstContent(getLevelCell(cell.getCrosstab().getCrosstabView(ICrosstabConstants.COLUMN_AXIS_TYPE)));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      exprDimColumn=dataItemHandle.getResultSetColumn();
    }
    ExtendedItemHandle chartHandle=cell.getCrosstabHandle().getElementFactory().newExtendedItem(null,ChartReportItemConstants.CHART_EXTENSION_NAME);
    ChartReportItemImpl reportItem=(ChartReportItemImpl)chartHandle.getReportItem();
    ChartWithAxes cm=createDefaultChart(exprMeasure,new String[]{exprDimRow,exprDimColumn});
    reportItem.setModel(cm);
    cell.addContent(chartHandle,0);
    if (cm.isTransposed()) {
      cell.setSpanOverOnRow(cell.getAggregationOnRow());
      CrosstabCellHandle rowCell=cell.getCrosstab().getDimension(ICrosstabConstants.ROW_AXIS_TYPE,0).getLevel(0).getCell();
      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));
      updateXtabForAxisChart(cell,chartHandle,ICrosstabConstants.ROW_AXIS_TYPE);
    }
 else {
      cell.setSpanOverOnColumn(cell.getAggregationOnColumn());
      CrosstabCellHandle columnCell=cell.getCrosstab().getDimension(ICrosstabConstants.COLUMN_AXIS_TYPE,0).getLevel(0).getCell();
      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));
      updateXtabForAxisChart(cell,chartHandle,ICrosstabConstants.COLUMN_AXIS_TYPE);
    }
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
}

Fixed version (ground truth):
public void switchView(AggregationCellHandle cell){
  try {
    Object content=getFirstContent(cell);
    String exprMeasure=getMeasureBindingExpr(content);
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
    String nameDimRow=null;
    content=getFirstContent(getLevelCell(cell.getCrosstab().getCrosstabView(ICrosstabConstants.ROW_AXIS_TYPE)));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      nameDimRow=dataItemHandle.getResultSetColumn();
    }
    String nameDimColumn=null;
    content=getFirstContent(getLevelCell(cell.getCrosstab().getCrosstabView(ICrosstabConstants.COLUMN_AXIS_TYPE)));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      nameDimColumn=dataItemHandle.getResultSetColumn();
    }
    ExtendedItemHandle chartHandle=cell.getCrosstabHandle().getElementFactory().newExtendedItem(null,ChartReportItemConstants.CHART_EXTENSION_NAME);
    ChartReportItemImpl reportItem=(ChartReportItemImpl)chartHandle.getReportItem();
    ChartWithAxes cm=createDefaultChart(exprMeasure,new String[]{nameDimRow,nameDimColumn});
    reportItem.setModel(cm);
    cell.addContent(chartHandle,0);
    if (cm.isTransposed()) {
      ChartXTabUtil.addAxisChartInXTab(cell,ICrosstabConstants.ROW_AXIS_TYPE,chartHandle);
    }
 else {
      ChartXTabUtil.addAxisChartInXTab(cell,ICrosstabConstants.COLUMN_AXIS_TYPE,chartHandle);
    }
  }
 catch (  BirtException e) {
    ExceptionHandler.handle(e);
  }
}