Program: 72339
Project: 72339
Buggy source:
@Override public void updateView(AggregationCellHandle cell,int type){
  Object contentItem=ChartXTabUtil.getFirstContent(cell);
  if (contentItem instanceof ExtendedItemHandle) {
    ExtendedItemHandle handle=(ExtendedItemHandle)contentItem;
    try {
      if (ChartXTabUtil.isPlotChart(handle)) {
        ChartReportItemImpl reportItem=(ChartReportItemImpl)handle.getReportItem();
        ChartWithAxes cm=(ChartWithAxes)reportItem.getProperty(ChartReportItemConstants.PROPERTY_CHART);
        ChartWithAxes cmNew=cm;
        if (cm == null) {
          return;
        }
        cmNew=(ChartWithAxes)EcoreUtil.copy(cm);
        if (type == CHANGE_ORIENTATION_TYPE) {
          cmNew.setTransposed(cell.getCrosstab().getMeasureDirection().equals(ICrosstabConstants.MEASURE_DIRECTION_HORIZONTAL));
        }
        updateChartQueries(cmNew,cell);
        reportItem.executeSetModelCommand(handle,cm,cmNew);
        if (cmNew.isTransposed()) {
          cell.setSpanOverOnRow(cell.getAggregationOnRow());
          cell.setSpanOverOnColumn(null);
        }
 else {
          cell.setSpanOverOnColumn(cell.getAggregationOnColumn());
          cell.setSpanOverOnRow(null);
        }
        if (type == CHANGE_ORIENTATION_TYPE) {
          ChartXTabUIUtil.updateXTabForAxis(cell,handle,cm.isTransposed(),cmNew);
        }
 else {
          ChartXTabUIUtil.updateAxisChart(cell,cmNew,handle);
          ChartXTabUIUtil.updateXTabDirection(cell.getCrosstab(),cmNew.isTransposed());
        }
        ChartInXTabStatusManager.updateGrandItemStatus(cell);
      }
 else       if (ChartXTabUtil.isAxisChart(handle)) {
        ExtendedItemHandle hostChartHandle=(ExtendedItemHandle)handle.getElementProperty(ChartReportItemConstants.PROPERTY_HOST_CHART);
        if (hostChartHandle == null) {
          handle.dropAndClear();
          return;
        }
        if (type != CHANGE_ORIENTATION_TYPE) {
          ChartReportItemImpl reportItem=(ChartReportItemImpl)handle.getReportItem();
          ChartWithAxes cm=(ChartWithAxes)reportItem.getProperty(ChartReportItemConstants.PROPERTY_CHART);
          ChartXTabUIUtil.updateXTabDirection(cell.getCrosstab(),cm.isTransposed());
        }
      }
    }
 catch (    BirtException e) {
      ExceptionHandler.handle(e);
    }
  }
}

Fixed version (ground truth):
@Override public void updateView(AggregationCellHandle cell,int type){
  Object contentItem=ChartXTabUtil.getFirstContent(cell);
  if (contentItem instanceof ExtendedItemHandle) {
    ExtendedItemHandle handle=(ExtendedItemHandle)contentItem;
    try {
      if (ChartXTabUtil.isPlotChart(handle)) {
        ChartReportItemImpl reportItem=(ChartReportItemImpl)handle.getReportItem();
        ChartWithAxes cm=(ChartWithAxes)reportItem.getProperty(ChartReportItemConstants.PROPERTY_CHART);
        ChartWithAxes cmNew=cm;
        if (cm == null) {
          return;
        }
        cmNew=(ChartWithAxes)EcoreUtil.copy(cm);
        if (type == CHANGE_ORIENTATION_TYPE && cell.getAggregationOnColumn() != null && cell.getAggregationOnRow() != null && !ChartXTabUtil.isAggregationCell(cell)) {
          cmNew.setTransposed(cell.getCrosstab().getMeasureDirection().equals(ICrosstabConstants.MEASURE_DIRECTION_HORIZONTAL));
        }
        updateChartQueries(cmNew,cell);
        reportItem.executeSetModelCommand(handle,cm,cmNew);
        if (cmNew.isTransposed()) {
          cell.setSpanOverOnRow(cell.getAggregationOnRow());
          cell.setSpanOverOnColumn(null);
        }
 else {
          cell.setSpanOverOnColumn(cell.getAggregationOnColumn());
          cell.setSpanOverOnRow(null);
        }
        if (type == CHANGE_ORIENTATION_TYPE) {
          ChartXTabUIUtil.updateXTabForAxis(cell,handle,cm.isTransposed(),cmNew);
        }
 else {
          ChartXTabUIUtil.updateAxisChart(cell,cmNew,handle);
          ChartXTabUIUtil.updateXTabDirection(cell.getCrosstab(),cmNew.isTransposed());
        }
        ChartInXTabStatusManager.updateGrandItemStatus(cell);
      }
 else       if (ChartXTabUtil.isAxisChart(handle)) {
        ExtendedItemHandle hostChartHandle=(ExtendedItemHandle)handle.getElementProperty(ChartReportItemConstants.PROPERTY_HOST_CHART);
        if (hostChartHandle == null) {
          handle.dropAndClear();
          return;
        }
        if (type != CHANGE_ORIENTATION_TYPE) {
          ChartReportItemImpl reportItem=(ChartReportItemImpl)handle.getReportItem();
          ChartWithAxes cm=(ChartWithAxes)reportItem.getProperty(ChartReportItemConstants.PROPERTY_CHART);
          ChartXTabUIUtil.updateXTabDirection(cell.getCrosstab(),cm.isTransposed());
        }
      }
    }
 catch (    BirtException e) {
      ExceptionHandler.handle(e);
    }
  }
}