Program: 70105
Project: 70105
Buggy source:
/** 
 * @param aggregationDef
 * @param facttableRowIterator
 * @throws DataException 
 */
AggregationCalculator(AggregationDefinition aggregationDef,DimColumn[] parameterColNames,IDataSet4Aggregation.MetaInfo metaInfo) throws IOException, DataException {
  Object[] params={aggregationDef,parameterColNames,metaInfo};
  logger.entering(AggregationCalculator.class.getName(),"String_Node_Str",params);
  this.aggregation=aggregationDef;
  AggregationFunctionDefinition[] aggregationFunction=aggregationDef.getAggregationFunctions();
  if (aggregationDef.getLevels() == null)   this.levelCount=0;
 else   this.levelCount=aggregationDef.getLevels().length;
  if (aggregationFunction != null) {
    this.accumulators=new Accumulator[aggregationFunction.length];
    this.measureIndexes=new int[aggregationFunction.length];
    this.parameterColIndex=new int[aggregationFunction.length];
    for (int i=0; i < aggregationFunction.length; i++) {
      IAggrFunction aggregation=AggregationManager.getInstance().getAggregation(aggregationFunction[i].getFunctionName());
      if (aggregation == null) {
        throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.UNSUPPORTED_FUNCTION) + aggregationFunction[i].getFunctionName());
      }
      if (AggregationUtil.needDataField(aggregation)) {
        this.parameterColIndex[i]=find(parameterColNames,aggregationFunction[i].getParaCol());
      }
 else {
        this.parameterColIndex[i]=-1;
      }
      this.accumulators[i]=aggregation.newAccumulator();
      this.accumulators[i].start();
      final String measureName=aggregationFunction[i].getMeasureName();
      this.measureIndexes[i]=metaInfo.getMeasureIndex(measureName);
      if (this.measureIndexes[i] == -1 && measureName != null) {
        throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,measureName);
      }
    }
  }
  result=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  measureInfos=metaInfo.getMeasureInfos();
  facttableRow=new FacttableRow(measureInfos);
  logger.exiting(AggregationCalculator.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param aggregationDef
 * @param facttableRowIterator
 * @throws DataException 
 */
AggregationCalculator(AggregationDefinition aggregationDef,DimColumn[] parameterColNames,IDataSet4Aggregation.MetaInfo metaInfo,ICubeDimensionReader cubeDimensionReader) throws IOException, DataException {
  Object[] params={aggregationDef,parameterColNames,metaInfo};
  logger.entering(AggregationCalculator.class.getName(),"String_Node_Str",params);
  this.aggregation=aggregationDef;
  AggregationFunctionDefinition[] aggregationFunction=aggregationDef.getAggregationFunctions();
  if (aggregationDef.getLevels() == null)   this.levelCount=0;
 else   this.levelCount=aggregationDef.getLevels().length;
  if (aggregationFunction != null) {
    this.accumulators=new Accumulator[aggregationFunction.length];
    this.measureIndexes=new int[aggregationFunction.length];
    this.parameterColIndex=new int[aggregationFunction.length];
    for (int i=0; i < aggregationFunction.length; i++) {
      IAggrFunction aggregation=AggregationManager.getInstance().getAggregation(aggregationFunction[i].getFunctionName());
      if (aggregation == null) {
        throw new DataException(DataResourceHandle.getInstance().getMessage(ResourceConstants.UNSUPPORTED_FUNCTION) + aggregationFunction[i].getFunctionName());
      }
      if (AggregationUtil.needDataField(aggregation)) {
        this.parameterColIndex[i]=find(parameterColNames,aggregationFunction[i].getParaCol());
      }
 else {
        this.parameterColIndex[i]=-1;
      }
      this.accumulators[i]=aggregation.newAccumulator();
      this.accumulators[i].start();
      final String measureName=aggregationFunction[i].getMeasureName();
      this.measureIndexes[i]=metaInfo.getMeasureIndex(measureName);
      if (this.measureIndexes[i] == -1 && measureName != null) {
        throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,measureName);
      }
    }
  }
  result=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  measureInfos=metaInfo.getMeasureInfos();
  facttableRow=new FacttableRow(measureInfos,cubeDimensionReader,metaInfo);
  logger.exiting(AggregationCalculator.class.getName(),"String_Node_Str");
}