Program: 67453
Project: 67453
Buggy source:
public DrilledAggregateResultSet(IAggregationResultSet aggregationRsFromCube,List<IEdgeDrillFilter[]> drillFilters) throws IOException, DataException {
  bufferedStructureArray=new BufferedStructureArray(AggregationResultRow.getCreator(),2000);
  this.dimLevel=aggregationRsFromCube.getAllLevels();
  this.aggregationRsFromCube=aggregationRsFromCube;
  if (aggregationRsFromCube.getAggregationCount() > 0) {
    AggregationDefinition aggr=aggregationRsFromCube.getAggregationDefinition();
    calculator=new DrilledAggregationCalculator(aggr);
  }
  for (int k=0; k < aggregationRsFromCube.length(); k++) {
    aggregationRsFromCube.seek(k);
    IEdgeDrillFilter targetDrill=getTargetDrillOperation(aggregationRsFromCube.getCurrentRow(),drillFilters);
    if (targetDrill == null) {
      bufferedStructureArray.add(aggregationRsFromCube.getCurrentRow());
      continue;
    }
    List<IAggregationResultRow> tempBufferArray=populateResultSet(aggregationRsFromCube,targetDrill);
    List<IEdgeDrillFilter[]> drills=this.getRemainingDrillOperation(targetDrill,drillFilters);
    if (!drills.isEmpty()) {
      tempBufferArray=populateNextResultSet(tempBufferArray,drills);
    }
    recalculateAggregation(tempBufferArray);
    removeDuplictedRow(tempBufferArray);
    sortAggregationRow(tempBufferArray);
    Iterator<IAggregationResultRow> iter=tempBufferArray.iterator();
    while (iter.hasNext())     bufferedStructureArray.add(iter.next());
    k=aggregationRsFromCube.getPosition();
  }
  this.resultObject=(IAggregationResultRow)bufferedStructureArray.get(0);
}

Fixed version (ground truth):
public DrilledAggregateResultSet(IAggregationResultSet aggregationRsFromCube,List<IEdgeDrillFilter[]> drillFilters) throws IOException, DataException {
  bufferedStructureArray=new BufferedStructureArray(AggregationResultRow.getCreator(),2000);
  this.dimLevel=aggregationRsFromCube.getAllLevels();
  this.aggregationRsFromCube=aggregationRsFromCube;
  if (aggregationRsFromCube.getAggregationCount() > 0) {
    AggregationDefinition aggr=aggregationRsFromCube.getAggregationDefinition();
    calculator=new DrilledAggregationCalculator(aggr);
  }
  for (int k=0; k < aggregationRsFromCube.length(); k++) {
    aggregationRsFromCube.seek(k);
    IEdgeDrillFilter targetDrill=getTargetDrillOperation(aggregationRsFromCube.getCurrentRow(),drillFilters);
    if (targetDrill == null) {
      bufferedStructureArray.add(aggregationRsFromCube.getCurrentRow());
      continue;
    }
    List<IAggregationResultRow> tempBufferArray=populateResultSet(aggregationRsFromCube,targetDrill);
    List<IEdgeDrillFilter[]> drills=this.getRemainingDrillOperation(targetDrill,drillFilters);
    if (!drills.isEmpty()) {
      tempBufferArray=populateNextResultSet(tempBufferArray,drills);
    }
    if (this.calculator == null) {
      removeDuplictedRow(tempBufferArray);
    }
 else     recalculateAggregation(tempBufferArray);
    sortAggregationRow(tempBufferArray);
    Iterator<IAggregationResultRow> iter=tempBufferArray.iterator();
    while (iter.hasNext())     bufferedStructureArray.add(iter.next());
    k=aggregationRsFromCube.getPosition();
  }
  this.resultObject=(IAggregationResultRow)bufferedStructureArray.get(0);
}