Program: 72943
Project: 72943
Buggy source:
private void addCubeFilter(ICubeQueryDefinition cubeQuery) throws BirtException {
  List levels=new ArrayList();
  List values=new ArrayList();
  Iterator filterItr=null;
  if (handle.getContainer() instanceof MultiViewsHandle) {
    filterItr=getCrosstabFiltersIterator();
  }
 else {
    filterItr=ChartReportItemUtil.getChartReportItemFromHandle(handle).getCubeFiltersIterator();
  }
  while (filterItr.hasNext()) {
    FilterConditionElementHandle filterCon=(FilterConditionElementHandle)filterItr.next();
    levels.clear();
    values.clear();
    addMembers(levels,values,filterCon.getMember());
    ILevelDefinition[] qualifyLevels=null;
    Object[] qualifyValues=null;
    if (levels.size() > 0) {
      qualifyLevels=(ILevelDefinition[])levels.toArray(new ILevelDefinition[levels.size()]);
      qualifyValues=values.toArray(new Object[values.size()]);
    }
    ConditionalExpression filterCondExpr;
    if (ModuleUtil.isListFilterValue(filterCon)) {
      filterCondExpr=new ConditionalExpression(filterCon.getExpr(),DataAdapterUtil.adaptModelFilterOperator(filterCon.getOperator()),filterCon.getValue1List());
    }
 else {
      filterCondExpr=new ConditionalExpression(filterCon.getExpr(),DataAdapterUtil.adaptModelFilterOperator(filterCon.getOperator()),filterCon.getValue1(),filterCon.getValue2());
    }
    ILevelDefinition levelDefinition=null;
    if (filterCon.getMember() != null) {
      levelDefinition=registeredLevelHandles.get(filterCon.getMember().getLevel());
    }
 else {
      levelDefinition=registeredLevels.get(ChartXTabUtil.getBindingName(filterCondExpr.getExpression().getText(),true));
    }
    ICubeFilterDefinition filterDef=ChartXTabUtil.getCubeElementFactory().creatCubeFilterDefinition(filterCondExpr,levelDefinition,qualifyLevels,qualifyValues);
    cubeQuery.addFilter(filterDef);
  }
}

Fixed version (ground truth):
private void addCubeFilter(ICubeQueryDefinition cubeQuery) throws BirtException {
  List levels=new ArrayList();
  List values=new ArrayList();
  Iterator filterItr=null;
  if (handle.getContainer() instanceof MultiViewsHandle) {
    filterItr=getCrosstabFiltersIterator();
  }
 else {
    filterItr=getCubeFiltersIterator();
  }
  while (filterItr.hasNext()) {
    FilterConditionElementHandle filterCon=(FilterConditionElementHandle)filterItr.next();
    levels.clear();
    values.clear();
    addMembers(levels,values,filterCon.getMember());
    ILevelDefinition[] qualifyLevels=null;
    Object[] qualifyValues=null;
    if (levels.size() > 0) {
      qualifyLevels=(ILevelDefinition[])levels.toArray(new ILevelDefinition[levels.size()]);
      qualifyValues=values.toArray(new Object[values.size()]);
    }
    ConditionalExpression filterCondExpr;
    if (ModuleUtil.isListFilterValue(filterCon)) {
      filterCondExpr=new ConditionalExpression(filterCon.getExpr(),DataAdapterUtil.adaptModelFilterOperator(filterCon.getOperator()),filterCon.getValue1List());
    }
 else {
      filterCondExpr=new ConditionalExpression(filterCon.getExpr(),DataAdapterUtil.adaptModelFilterOperator(filterCon.getOperator()),filterCon.getValue1(),filterCon.getValue2());
    }
    ILevelDefinition levelDefinition=null;
    if (filterCon.getMember() != null) {
      levelDefinition=registeredLevelHandles.get(filterCon.getMember().getLevel());
    }
 else {
      levelDefinition=registeredLevels.get(ChartXTabUtil.getBindingName(filterCondExpr.getExpression().getText(),true));
    }
    ICubeFilterDefinition filterDef=ChartXTabUtil.getCubeElementFactory().creatCubeFilterDefinition(filterCondExpr,levelDefinition,qualifyLevels,qualifyValues);
    cubeQuery.addFilter(filterDef);
  }
}