Program: 73507
Project: 73507
Buggy source:
public void switchView(AggregationCellHandle cell){
  try {
    Object content=getFirstContent(cell);
    String exprMeasure=getMeasureBindingExpr(content);
    if (content instanceof DesignElementHandle) {
      ((DesignElementHandle)content).dropAndClear();
    }
    String nameDimRow=null;
    LevelViewHandle levelView=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.ROW_AXIS_TYPE);
    if (levelView != null) {
      content=getFirstContent(levelView.getCell());
      if (content instanceof DataItemHandle) {
        DataItemHandle dataItemHandle=(DataItemHandle)content;
        nameDimRow=dataItemHandle.getResultSetColumn();
      }
    }
    String nameDimColumn=null;
    levelView=ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.COLUMN_AXIS_TYPE);
    if (levelView != null) {
      content=getFirstContent(levelView.getCell());
      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);
  }
}

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(ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),ICrosstabConstants.ROW_AXIS_TYPE));
    if (content instanceof DataItemHandle) {
      DataItemHandle dataItemHandle=(DataItemHandle)content;
      nameDimRow=dataItemHandle.getResultSetColumn();
    }
    String nameDimColumn=null;
    content=getFirstContent(ChartXTabUtil.getInnermostLevelCell(cell.getCrosstab(),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);
  }
}