Program: 77385
Project: 77385
Buggy source:
/** 
 * populate all output columns in viewer display. The output columns is retrieved from oda dataset handles's RESULT_SET_PROP and COMPUTED_COLUMNS_PROP.
 * @throws BirtException
 */
public static IResultMetaData retrieveResultMetaData(DataSetHandle dataSetHandle) throws BirtException {
  List resultSetList=null;
  if (dataSetHandle instanceof OdaDataSetHandle) {
    resultSetList=(List)dataSetHandle.getProperty(OdaDataSetHandle.RESULT_SET_PROP);
  }
 else {
    return null;
  }
  List computedList=(List)dataSetHandle.getProperty(OdaDataSetHandle.COMPUTED_COLUMNS_PROP);
  List columnMeta=new ArrayList();
  ResultSetColumnDefinition columnDef;
  int index=0;
  if (resultSetList != null) {
    ResultSetColumn resultSetColumn;
    for (int i=0; i < resultSetList.size(); i++) {
      resultSetColumn=(ResultSetColumn)resultSetList.get(i);
      columnDef=new ResultSetColumnDefinition(resultSetColumn.getColumnName());
      columnDef.setDataTypeName(resultSetColumn.getDataType());
      columnDef.setDataType(ModelAdapter.adaptModelDataType(resultSetColumn.getDataType()));
      columnDef.setColumnPosition(resultSetColumn.getPosition().intValue());
      columnDef.setComputedColumn(false);
      columnMeta.add(columnDef);
      index++;
    }
    if (computedList != null) {
      ComputedColumn computedColumn;
      Iterator computedColumnIterator=computedList.iterator();
      while (computedColumnIterator.hasNext()) {
        computedColumn=(ComputedColumn)computedColumnIterator.next();
        columnDef=new ResultSetColumnDefinition(computedColumn.getName());
        columnDef.setDataTypeName(computedColumn.getDataType());
        columnDef.setDataType(ModelAdapter.adaptModelDataType(computedColumn.getDataType()));
        if (findColumnHint(dataSetHandle,computedColumn.getName()) != null) {
          ColumnHintHandle columnHint=findColumnHint(dataSetHandle,computedColumn.getName());
          columnDef.setAlias(columnHint.getAlias());
          columnDef.setLableName(columnHint.getDisplayName());
        }
        columnDef.setComputedColumn(true);
        columnMeta.add(columnDef);
        index++;
      }
    }
    return new ResultMetaData2(columnMeta);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * populate all output columns in viewer display. The output columns is retrieved from oda dataset handles's RESULT_SET_PROP and COMPUTED_COLUMNS_PROP.
 * @throws BirtException
 */
public static IResultMetaData retrieveResultMetaData(DataSetHandle dataSetHandle) throws BirtException {
  List resultSetList=null;
  if (dataSetHandle instanceof OdaDataSetHandle) {
    resultSetList=(List)dataSetHandle.getProperty(OdaDataSetHandle.RESULT_SET_PROP);
  }
 else {
    return null;
  }
  List computedList=(List)dataSetHandle.getProperty(OdaDataSetHandle.COMPUTED_COLUMNS_PROP);
  List columnMeta=new ArrayList();
  ResultSetColumnDefinition columnDef;
  int index=0;
  if (resultSetList != null) {
    ResultSetColumn resultSetColumn;
    for (int i=0; i < resultSetList.size(); i++) {
      resultSetColumn=(ResultSetColumn)resultSetList.get(i);
      columnDef=new ResultSetColumnDefinition(resultSetColumn.getColumnName());
      columnDef.setDataTypeName(resultSetColumn.getDataType());
      columnDef.setDataType(ModelAdapter.adaptModelDataType(resultSetColumn.getDataType()));
      if (resultSetColumn.getPosition() != null)       columnDef.setColumnPosition(resultSetColumn.getPosition().intValue());
      if (resultSetColumn.getNativeDataType() != null)       columnDef.setNativeDataType(resultSetColumn.getNativeDataType().intValue());
      columnDef.setComputedColumn(false);
      columnMeta.add(columnDef);
      index++;
    }
    if (computedList != null) {
      ComputedColumn computedColumn;
      Iterator computedColumnIterator=computedList.iterator();
      while (computedColumnIterator.hasNext()) {
        computedColumn=(ComputedColumn)computedColumnIterator.next();
        columnDef=new ResultSetColumnDefinition(computedColumn.getName());
        columnDef.setDataTypeName(computedColumn.getDataType());
        columnDef.setDataType(ModelAdapter.adaptModelDataType(computedColumn.getDataType()));
        if (findColumnHint(dataSetHandle,computedColumn.getName()) != null) {
          ColumnHintHandle columnHint=findColumnHint(dataSetHandle,computedColumn.getName());
          columnDef.setAlias(columnHint.getAlias());
          columnDef.setLableName(columnHint.getDisplayName());
        }
        columnDef.setComputedColumn(true);
        columnMeta.add(columnDef);
        index++;
      }
    }
    return new ResultMetaData2(columnMeta);
  }
  return null;
}