Program: 67772
Project: 67772
Buggy source:
/** 
 * @param resultSet
 * @throws DataException
 * @throws IOException
 */
public List getCubePosFilters(List jsMeasureEvalFilterHelper) throws DataException, IOException {
  String[] aggregationNames=populateAggregationNames(jsMeasureEvalFilterHelper);
  List cubePosFilterList=new ArrayList();
  for (int i=0; i < resultSet.length; i++) {
    if (hasDefinition(resultSet[i],aggregationNames)) {
      if (resultSet[i].getAllLevels() == null || resultSet[i].getAllLevels().length == 0) {
        AggregationRowAccessor rowAccessor=new AggregationRowAccessor(resultSet[i]);
        for (int j=0; j < jsMeasureEvalFilterHelper.size(); j++) {
          if (resultSet[i].getAggregationIndex(aggregationNames[j]) >= 0) {
            IAggrMeasureFilterEvalHelper filterHelper=(IAggrMeasureFilterEvalHelper)jsMeasureEvalFilterHelper.get(j);
            if (!filterHelper.evaluateFilter(rowAccessor)) {
              return null;
            }
          }
        }
        continue;
      }
      Map levelMap=populateLevelMap(resultSet[i]);
      final int dimSize=levelMap.size();
      List[] levelListArray=new List[dimSize];
      levelMap.values().toArray(levelListArray);
      String[] dimensionNames=new String[dimSize];
      levelMap.keySet().toArray(dimensionNames);
      IDiskArray rowIndexArray=collectValidRowIndexArray(resultSet[i],jsMeasureEvalFilterHelper,aggregationNames);
      CubePosFilter cubePosFilter=null;
      ;
      if (rowIndexArray.size() <= resultSet[i].length() / 2) {
        cubePosFilter=getValidPosFilter(resultSet[i],rowIndexArray,dimensionNames,levelListArray);
      }
 else {
        cubePosFilter=getInvalidPosFilter(resultSet[i],rowIndexArray,dimensionNames,levelListArray);
      }
      cubePosFilterList.add(cubePosFilter);
    }
  }
  return cubePosFilterList;
}

Fixed version (ground truth):
/** 
 * @param resultSet
 * @throws DataException
 * @throws IOException
 */
public List getCubePosFilters(List jsMeasureEvalFilterHelper) throws DataException, IOException {
  String[] aggregationNames=populateAggregationNames(jsMeasureEvalFilterHelper);
  List cubePosFilterList=new ArrayList();
  for (int i=0; i < resultSet.length; i++) {
    if (hasDefinition(resultSet[i],aggregationNames)) {
      if (resultSet[i].getAllLevels() == null || resultSet[i].getAllLevels().length == 0) {
        if (resultSet[i].length() == 0)         return null;
        AggregationRowAccessor rowAccessor=new AggregationRowAccessor(resultSet[i]);
        for (int j=0; j < jsMeasureEvalFilterHelper.size(); j++) {
          if (resultSet[i].getAggregationIndex(aggregationNames[j]) >= 0) {
            IAggrMeasureFilterEvalHelper filterHelper=(IAggrMeasureFilterEvalHelper)jsMeasureEvalFilterHelper.get(j);
            if (!filterHelper.evaluateFilter(rowAccessor)) {
              return null;
            }
          }
        }
        continue;
      }
      Map levelMap=populateLevelMap(resultSet[i]);
      final int dimSize=levelMap.size();
      List[] levelListArray=new List[dimSize];
      levelMap.values().toArray(levelListArray);
      String[] dimensionNames=new String[dimSize];
      levelMap.keySet().toArray(dimensionNames);
      IDiskArray rowIndexArray=collectValidRowIndexArray(resultSet[i],jsMeasureEvalFilterHelper,aggregationNames);
      CubePosFilter cubePosFilter=null;
      ;
      if (rowIndexArray.size() <= resultSet[i].length() / 2) {
        cubePosFilter=getValidPosFilter(resultSet[i],rowIndexArray,dimensionNames,levelListArray);
      }
 else {
        cubePosFilter=getInvalidPosFilter(resultSet[i],rowIndexArray,dimensionNames,levelListArray);
      }
      cubePosFilterList.add(cubePosFilter);
    }
  }
  return cubePosFilterList;
}