Program: 69665
Project: 69665
Buggy source:
/** 
 * This method is responsible for computing the aggregation result according to the specified aggregation definitions.
 * @param aggregations
 * @param stopSign
 * @return
 * @throws DataException
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet[] onePassExecute(AggregationDefinition[] aggregations,StopSign stopSign) throws DataException, IOException, BirtException {
  IDiskArray[] dimPosition=getFilterResult();
  int count=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      count++;
    }
  }
  IDimension[] dimensions=cube.getDimesions();
  String[] validDimensionName=new String[count];
  IDiskArray[] validDimPosition=new IDiskArray[count];
  int pos=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      validDimPosition[pos]=dimPosition[i];
      validDimensionName[pos]=dimensions[i].getName();
      pos++;
    }
  }
  FactTableRowIterator factTableRowIterator=new FactTableRowIterator(cube.getFactTable(),validDimensionName,validDimPosition,populateDimensionResultIterator(stopSign),null,stopSign);
  if (cubePosFilters != null && !cubePosFilters.isEmpty()) {
    for (Iterator itr=cubePosFilters.iterator(); itr.hasNext(); ) {
      ICubePosFilter cubePosFilter=(ICubePosFilter)itr.next();
      factTableRowIterator.addCubePosFilter(cubePosFilter);
    }
  }
  for (int i=0; i < measureFilters.size(); i++) {
    factTableRowIterator.addMeasureFilter((IJSFacttableFilterEvalHelper)measureFilters.get(i));
  }
  DimensionResultIterator[] dimensionResultIterators=populateDimensionResultIterator(dimPosition,stopSign);
  IDataSet4Aggregation dataSet4Aggregation=new DataSetFromOriginalCube(factTableRowIterator,dimensionResultIterators,computedMeasureHelper);
  AggregationExecutor aggregationCalculatorExecutor=new AggregationExecutor(new CubeDimensionReader(cube),dataSet4Aggregation,aggregations);
  return aggregationCalculatorExecutor.execute(stopSign);
}

Fixed version (ground truth):
/** 
 * This method is responsible for computing the aggregation result according to the specified aggregation definitions.
 * @param aggregations
 * @param stopSign
 * @return
 * @throws DataException
 * @throws IOException
 * @throws BirtException
 */
private IAggregationResultSet[] onePassExecute(AggregationDefinition[] aggregations,StopSign stopSign) throws DataException, IOException, BirtException {
  IDiskArray[] dimPosition=getFilterResult();
  int count=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      count++;
    }
  }
  IDimension[] dimensions=cube.getDimesions();
  String[] validDimensionName=new String[count];
  IDiskArray[] validDimPosition=new IDiskArray[count];
  int pos=0;
  for (int i=0; i < dimPosition.length; i++) {
    if (dimPosition[i] != null) {
      validDimPosition[pos]=dimPosition[i];
      validDimensionName[pos]=dimensions[i].getName();
      pos++;
    }
  }
  FactTableRowIterator factTableRowIterator=new FactTableRowIterator(cube.getFactTable(),validDimensionName,validDimPosition,cube.getDimesions(),null,stopSign);
  if (cubePosFilters != null && !cubePosFilters.isEmpty()) {
    for (Iterator itr=cubePosFilters.iterator(); itr.hasNext(); ) {
      ICubePosFilter cubePosFilter=(ICubePosFilter)itr.next();
      factTableRowIterator.addCubePosFilter(cubePosFilter);
    }
  }
  for (int i=0; i < measureFilters.size(); i++) {
    factTableRowIterator.addMeasureFilter((IJSFacttableFilterEvalHelper)measureFilters.get(i));
  }
  DimensionResultIterator[] dimensionResultIterators=populateDimensionResultIterator(dimPosition,stopSign);
  IDataSet4Aggregation dataSet4Aggregation=new DataSetFromOriginalCube(factTableRowIterator,dimensionResultIterators,computedMeasureHelper);
  AggregationExecutor aggregationCalculatorExecutor=new AggregationExecutor(new CubeDimensionReader(cube),dataSet4Aggregation,aggregations);
  return aggregationCalculatorExecutor.execute(stopSign);
}