Program: 72813
Project: 72813
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();
      this.measureIndexes[i]=metaInfo.getMeasureIndex(aggregationFunction[i].getMeasureName());
      if ((this.measureIndexes[i] == -1 && AggregationUtil.needDataField(aggregation))) {
        throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,aggregationFunction[i].getMeasureName());
      }
    }
  }
  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) 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();
      this.measureIndexes[i]=metaInfo.getMeasureIndex(aggregationFunction[i].getMeasureName());
    }
  }
  result=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  measureInfos=metaInfo.getMeasureInfos();
  facttableRow=new FacttableRow(measureInfos);
  logger.exiting(AggregationCalculator.class.getName(),"String_Node_Str");
}