Program: 73098
Project: 73098
Buggy source:
/** 
 * @param crosstab
 * @param measureView
 * @param function
 * @param rowDimension
 * @param rowLevel
 * @param colDimension
 * @param colLevel
 * @throws SemanticException
 */
public static void addDataItem(CrosstabReportItemHandle crosstab,AggregationCellHandle cell,MeasureViewHandle measureView,String function,String rowDimension,String rowLevel,String colDimension,String colLevel,boolean forceAdd) throws SemanticException {
  if (crosstab == null || measureView == null)   return;
  if (cell == null) {
    cell=measureView.getAggregationCell(rowDimension,rowLevel,colDimension,colLevel);
  }
  if (cell == null && forceAdd) {
    cell=measureView.addAggregation(rowDimension,rowLevel,colDimension,colLevel);
  }
  if (cell != null && cell.getContents().size() == 0) {
    String name=CrosstabModelUtil.generateComputedColumnName(measureView,colLevel,rowLevel);
    ComputedColumn column=StructureFactory.newComputedColumn(crosstab.getModelHandle(),name);
    String dataType=measureView.getDataType();
    column.setDataType(dataType);
    column.setExpression(ExpressionUtil.createJSMeasureExpression(measureView.getCubeMeasureName()));
    column.setAggregateFunction(function != null ? function : getDefaultMeasureAggregationFunction(measureView));
    if (rowLevel != null) {
      column.addAggregateOn(rowLevel);
    }
    if (colLevel != null) {
      column.addAggregateOn(colLevel);
    }
    ComputedColumnHandle columnHandle=((ReportItemHandle)crosstab.getModelHandle()).addColumnBinding(column,false);
    DataItemHandle dataItem=crosstab.getModuleHandle().getElementFactory().newDataItem(null);
    dataItem.setResultSetColumn(columnHandle.getName());
    cell.addContent(dataItem);
  }
}

Fixed version (ground truth):
/** 
 * @param crosstab
 * @param measureView
 * @param function
 * @param rowDimension
 * @param rowLevel
 * @param colDimension
 * @param colLevel
 * @throws SemanticException
 */
public static void addDataItem(CrosstabReportItemHandle crosstab,AggregationCellHandle cell,MeasureViewHandle measureView,String function,String rowDimension,String rowLevel,String colDimension,String colLevel,boolean forceAdd) throws SemanticException {
  if (crosstab == null || measureView == null)   return;
  if (cell == null) {
    cell=measureView.getAggregationCell(rowDimension,rowLevel,colDimension,colLevel);
  }
  if (cell == null && forceAdd) {
    cell=measureView.addAggregation(rowDimension,rowLevel,colDimension,colLevel);
  }
  if (cell != null) {
    String name=CrosstabModelUtil.generateComputedColumnName(measureView,colLevel,rowLevel);
    ComputedColumn column=StructureFactory.newComputedColumn(crosstab.getModelHandle(),name);
    String dataType=measureView.getDataType();
    column.setDataType(dataType);
    column.setExpression(ExpressionUtil.createJSMeasureExpression(measureView.getCubeMeasureName()));
    column.setAggregateFunction(function != null ? function : getDefaultMeasureAggregationFunction(measureView));
    if (rowLevel != null) {
      column.addAggregateOn(rowLevel);
    }
    if (colLevel != null) {
      column.addAggregateOn(colLevel);
    }
    ComputedColumnHandle columnHandle=((ReportItemHandle)crosstab.getModelHandle()).addColumnBinding(column,false);
    if (cell.getContents().size() == 0) {
      DataItemHandle dataItem=crosstab.getModuleHandle().getElementFactory().newDataItem(null);
      dataItem.setResultSetColumn(columnHandle.getName());
      cell.addContent(dataItem);
    }
 else     if (cell.getContents().size() == 1 && cell.getContents().get(0) instanceof DataItemHandle) {
      DataItemHandle dataItem=(DataItemHandle)cell.getContents().get(0);
      dataItem.setResultSetColumn(columnHandle.getName());
    }
  }
}