Program: 75586
Project: 75586
Buggy source:
/** 
 * @param aggregationDef
 * @param facttableRowIterator
 * @throws DataException 
 */
AggregationCalculator(AggregationDefinition aggregationDef,String[] paramterColNames,IFactTableRowIterator facttableRowIterator) throws DataException {
  Object[] params={aggregationDef,facttableRowIterator};
  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.measureIndex=new int[aggregationFunction.length];
    this.parameterColIndex=new int[aggregationFunction.length];
    for (int i=0; i < aggregationFunction.length; i++) {
      IAggregation aggregation=BuiltInAggregationFactory.getInstance().getAggregation(aggregationFunction[i].getFunctionName());
      if (aggregation.getParameterDefn() != null && aggregation.getParameterDefn().length > 1) {
        this.parameterColIndex[i]=find(paramterColNames,aggregationFunction[i].getParaColName());
      }
 else {
        this.parameterColIndex[i]=-1;
      }
      this.accumulators[i]=aggregation.newAccumulator();
      this.accumulators[i].start();
      this.measureIndex[i]=facttableRowIterator.getMeasureIndex(aggregationFunction[i].getMeasureName());
      if (this.measureIndex[i] == -1) {
        throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,aggregationFunction[i].getMeasureName());
      }
    }
  }
  result=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  logger.exiting(AggregationCalculator.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @param aggregationDef
 * @param facttableRowIterator
 * @throws DataException 
 */
AggregationCalculator(AggregationDefinition aggregationDef,DimColumn[] paramterColNames,IFactTableRowIterator facttableRowIterator) throws DataException {
  Object[] params={aggregationDef,facttableRowIterator};
  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.measureIndex=new int[aggregationFunction.length];
    this.parameterColIndex=new int[aggregationFunction.length];
    for (int i=0; i < aggregationFunction.length; i++) {
      IAggregation aggregation=BuiltInAggregationFactory.getInstance().getAggregation(aggregationFunction[i].getFunctionName());
      if (aggregation.getParameterDefn() != null && aggregation.getParameterDefn().length > 1) {
        this.parameterColIndex[i]=find(paramterColNames,aggregationFunction[i].getParaCol());
      }
 else {
        this.parameterColIndex[i]=-1;
      }
      this.accumulators[i]=aggregation.newAccumulator();
      this.accumulators[i].start();
      this.measureIndex[i]=facttableRowIterator.getMeasureIndex(aggregationFunction[i].getMeasureName());
      if (this.measureIndex[i] == -1) {
        throw new DataException(ResourceConstants.MEASURE_NAME_NOT_FOUND,aggregationFunction[i].getMeasureName());
      }
    }
  }
  result=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  logger.exiting(AggregationCalculator.class.getName(),"String_Node_Str");
}