Program: 65542
Project: 65542
Buggy source:
public void populateFilterHelpers() throws DataException {
  if (populateFilter)   return;
  List filters=defn.getFilters();
  Set<DimLevel> dimLevelInCubeQuery=this.getDimLevelsDefinedInCubeQuery();
  validateFilter(filters,defn.getBindings());
  for (int i=0; i < filters.size(); i++) {
    IFilterDefinition filter=(IFilterDefinition)filters.get(i);
    if (!filter.updateAggregation()) {
      Set dimLevelSet=OlapExpressionCompiler.getReferencedDimLevel(filter.getExpression(),defn.getBindings());
      if (dimLevelSet.size() <= 1) {
        continue;
      }
 else {
        if (!adjustCubeFilterUpdateAggregationFlag(filter,dimLevelSet))         continue;
      }
    }
switch (this.getFilterType(filter,dimLevelInCubeQuery)) {
case CubeQueryExecutor.DIMENSION_FILTER:
{
        SimpleLevelFilter simpleLevelfilter=createSimpleLevelFilter(filter,defn.getBindings());
        if (simpleLevelfilter == null) {
          this.dimensionFilterEvalHelpers.add(BaseDimensionFilterEvalHelper.createFilterHelper(this.outResults,this.scope,defn,filter,this.session.getEngineContext().getScriptContext()));
        }
 else {
          boolean existLevelFilter=false;
          for (int j=0; j < this.dimensionSimpleFilter.size(); j++) {
            if (dimensionSimpleFilter.get(j).getDimensionName().equals(simpleLevelfilter.getDimensionName()) && dimensionSimpleFilter.get(j).getLevelName().equals(simpleLevelfilter.getLevelName())) {
              this.dimensionFilterEvalHelpers.add(BaseDimensionFilterEvalHelper.createFilterHelper(this.outResults,this.scope,defn,filter,this.session.getEngineContext().getScriptContext()));
              existLevelFilter=true;
              break;
            }
          }
          if (!existLevelFilter)           this.dimensionSimpleFilter.add(simpleLevelfilter);
        }
        break;
      }
case CubeQueryExecutor.AGGR_MEASURE_FILTER:
{
      this.aggrMeasureFilterEvalHelpers.add(new AggrMeasureFilterEvalHelper(this.outResults,scope,defn,filter,session.getEngineContext().getScriptContext()));
      break;
    }
case CubeQueryExecutor.FACTTABLE_FILTER:
default :
{
    this.advancedFacttableBasedFilterEvalHelper.add(new JSFacttableFilterEvalHelper(scope,this.session.getEngineContext().getScriptContext(),filter,this.outResults,this.defn));
  }
}
}
populateFilter=true;
}

Fixed version (ground truth):
public void populateFilterHelpers() throws DataException {
  if (populateFilter)   return;
  List filters=defn.getFilters();
  Set<DimLevel> dimLevelInCubeQuery=this.getDimLevelsDefinedInCubeQuery();
  validateFilter(filters,defn.getBindings());
  for (int i=0; i < filters.size(); i++) {
    IFilterDefinition filter=(IFilterDefinition)filters.get(i);
    if (!filter.updateAggregation()) {
      Set dimLevelSet=OlapExpressionCompiler.getReferencedDimLevel(filter.getExpression(),defn.getBindings());
      if (dimLevelSet.size() <= 1) {
        continue;
      }
 else {
        if (!adjustCubeFilterUpdateAggregationFlag(filter,dimLevelSet))         continue;
      }
    }
switch (this.getFilterType(filter,dimLevelInCubeQuery)) {
case CubeQueryExecutor.DIMENSION_FILTER:
{
        SimpleLevelFilter simpleLevelfilter=createSimpleLevelFilter(filter,defn.getBindings());
        if (simpleLevelfilter == null) {
          this.dimensionFilterEvalHelpers.add(BaseDimensionFilterEvalHelper.createFilterHelper(this.outResults,this.scope,defn,filter,this.session.getEngineContext().getScriptContext()));
        }
 else {
          boolean existLevelFilter=false;
          for (int j=0; j < this.dimensionSimpleFilter.size(); j++) {
            if (dimensionSimpleFilter.get(j).getDimensionName().equals(simpleLevelfilter.getDimensionName()) && dimensionSimpleFilter.get(j).getLevelName().equals(simpleLevelfilter.getLevelName())) {
              this.dimensionFilterEvalHelpers.add(BaseDimensionFilterEvalHelper.createFilterHelper(this.outResults,this.scope,defn,filter,this.session.getEngineContext().getScriptContext()));
              existLevelFilter=true;
              break;
            }
          }
          if (!existLevelFilter)           this.dimensionSimpleFilter.add(simpleLevelfilter);
        }
        break;
      }
case CubeQueryExecutor.AGGR_MEASURE_FILTER:
{
      this.aggrMeasureFilterEvalHelpers.add(new AggrMeasureFilterEvalHelper(this.outResults,scope,defn,filter,session.getEngineContext().getScriptContext()));
      break;
    }
case CubeQueryExecutor.AGGR_OPERATION_FILTER:
{
    this.aggrFilterEvalHelpersOnCubeOperator.add(new AggrMeasureFilterEvalHelper(this.outResults,scope,defn,filter,session.getEngineContext().getScriptContext()));
    break;
  }
case CubeQueryExecutor.FACTTABLE_FILTER:
default :
{
  this.advancedFacttableBasedFilterEvalHelper.add(new JSFacttableFilterEvalHelper(scope,this.session.getEngineContext().getScriptContext(),filter,this.outResults,this.defn));
}
}
}
populateFilter=true;
}