Program: 73497
Project: 73497
Buggy source:
/** 
 * @param aggregations
 * @param resultSet
 * @param j
 * @param filter
 * @param levelFilters
 * @throws IOException
 * @throws DataException
 */
private void applyAggrFilter(AggregationDefinition[] aggregations,IAggregationResultSet[] resultSet,int j,AggrFilterDefinition filter,List levelFilters) throws DataException, IOException {
  DimLevel targetLevel=filter.getTargetLevel();
  ILevel[] levelsOfDimension=getLevelsOfDimension(targetLevel.getDimensionName());
  int targetIndex=FilterUtil.getTargetLevelIndex(levelsOfDimension,targetLevel.getLevelName());
  List selKeyValueList=new ArrayList();
  Member[] preMembers=null;
  IJSDimensionFilterHelper filterHelper=(IJSDimensionFilterHelper)filter.getFilterHelper();
  AggregationRowAccessor row4filter=new AggregationRowAccessor(resultSet[j]);
  for (int k=0; k < resultSet[j].length(); k++) {
    resultSet[j].seek(k);
    boolean isSelect=filterHelper.evaluateFilter(row4filter);
    if (isSelect) {
      Member[] members=getTargetDimMembers(targetLevel.getDimensionName(),resultSet[j]);
      if (preMembers != null && !FilterUtil.shareParentLevels(members,preMembers,targetIndex)) {
        LevelFilter levelFilter=toLevelFilter(targetLevel,selKeyValueList,preMembers,filterHelper);
        levelFilters.add(levelFilter);
        selKeyValueList.clear();
      }
      int levelIndex=resultSet[j].getLevelIndex(targetLevel);
      Object[] levelKeyValue=resultSet[j].getLevelKeyValue(levelIndex);
      if (levelKeyValue != null && levelKeyValue[0] != null)       selKeyValueList.add(levelKeyValue);
      preMembers=members;
    }
  }
  if (preMembers == null) {
    isEmptyXtab=true;
    return;
  }
  if (!selKeyValueList.isEmpty()) {
    LevelFilter levelFilter=toLevelFilter(targetLevel,selKeyValueList,preMembers,filterHelper);
    levelFilters.add(levelFilter);
  }
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @param filter
 * @param levelFilters
 * @throws IOException
 * @throws DataException
 */
private void applyAggrFilter(IAggregationResultSet resultSet,AggrFilterDefinition filter,List levelFilters) throws DataException, IOException {
  DimLevel targetLevel=filter.getTargetLevel();
  ILevel[] levelsOfDimension=getLevelsOfDimension(targetLevel.getDimensionName());
  int targetIndex=FilterUtil.getTargetLevelIndex(levelsOfDimension,targetLevel.getLevelName());
  List selKeyValueList=new ArrayList();
  Member[] preMembers=null;
  IJSDimensionFilterHelper filterHelper=(IJSDimensionFilterHelper)filter.getFilterHelper();
  AggregationRowAccessor row4filter=new AggregationRowAccessor(resultSet);
  for (int k=0; k < resultSet.length(); k++) {
    resultSet.seek(k);
    boolean isSelect=filterHelper.evaluateFilter(row4filter);
    if (isSelect) {
      Member[] members=getTargetDimMembers(targetLevel.getDimensionName(),resultSet);
      if (preMembers != null && !FilterUtil.shareParentLevels(members,preMembers,targetIndex)) {
        LevelFilter levelFilter=toLevelFilter(targetLevel,selKeyValueList,preMembers,filterHelper);
        levelFilters.add(levelFilter);
        selKeyValueList.clear();
      }
      int levelIndex=resultSet.getLevelIndex(targetLevel);
      Object[] levelKeyValue=resultSet.getLevelKeyValue(levelIndex);
      if (levelKeyValue != null && levelKeyValue[0] != null)       selKeyValueList.add(levelKeyValue);
      preMembers=members;
    }
  }
  if (preMembers == null) {
    isEmptyXtab=true;
    return;
  }
  if (!selKeyValueList.isEmpty()) {
    LevelFilter levelFilter=toLevelFilter(targetLevel,selKeyValueList,preMembers,filterHelper);
    levelFilters.add(levelFilter);
  }
}