Program: 75449
Project: 75449
Buggy source:
/** 
 * @param parentScope
 * @param queryDefn
 * @param cubeFilter
 * @param cx
 * @throws DataException
 */
protected void initialize(Scriptable parentScope,ICubeQueryDefinition queryDefn,IFilterDefinition cubeFilter,Context cx) throws DataException {
  this.scope=cx.initStandardObjects();
  this.scope.setParentScope(parentScope);
  this.dataObj=new DummyJSAggregationAccessor();
  this.expr=cubeFilter.getExpression();
  this.dimName=OlapExpressionUtil.getReferencedDimensionName(this.expr,queryDefn.getBindings());
  this.dimObj=new DummyJSLevels(this.dimName);
  this.queryDefn=queryDefn;
  if (cubeFilter instanceof ICubeFilterDefinition) {
    this.cubeFilter=(ICubeFilterDefinition)cubeFilter;
  }
 else {
    this.cubeFilter=new CubeFilterDefinition(this.expr);
  }
  this.aggrLevels=populateAggrLevels();
  axisLevels=this.cubeFilter.getAxisQualifierLevels();
  axisValues=this.cubeFilter.getAxisQualifierValues();
  if (axisLevels == null || axisValues == null || axisLevels.length != axisValues.length) {
    this.isAxisFilter=false;
  }
 else {
    for (int i=0; i < axisLevels.length; i++) {
      if (axisLevels[i] == null)       throw new DataException(ResourceConstants.AXIS_LEVEL_CANNOT_BE_NULL);
      if (axisValues[i] == null)       throw new DataException(ResourceConstants.AXIS_VALUE_CANNOT_BE_NULL,axisLevels[i].getName());
    }
  }
  this.isAxisFilter=(axisLevels != null && axisValues != null && axisLevels.length == axisValues.length);
  if (this.dimName != null) {
    DummyJSDimensionObject dimObj=new DummyJSDimensionObject(this.dimObj,this.getTargetDimensionLevelNames());
    this.scope.put("String_Node_Str",this.scope,new DummyJSDimensionAccessor(this.dimName,dimObj));
  }
  if (this.aggrLevels != null && this.aggrLevels.length > 0) {
    this.scope.put("String_Node_Str",this.scope,this.dataObj);
  }
 else {
    this.scope.put("String_Node_Str",this.scope,new DummyJSDataAccessor(queryDefn.getBindings(),this.scope));
  }
  OLAPExpressionCompiler.compile(cx,this.expr);
}

Fixed version (ground truth):
/** 
 * @param parentScope
 * @param queryDefn
 * @param cubeFilter
 * @param cx
 * @throws DataException
 */
protected void initialize(Scriptable parentScope,ICubeQueryDefinition queryDefn,IFilterDefinition cubeFilter,Context cx) throws DataException {
  this.scope=cx.initStandardObjects();
  this.scope.setParentScope(parentScope);
  this.dataObj=new DummyJSAggregationAccessor();
  this.expr=cubeFilter.getExpression();
  this.dimName=OlapExpressionUtil.getReferencedDimensionName(this.expr,queryDefn.getBindings());
  this.dimObj=new DummyJSLevels(this.dimName);
  this.queryDefn=queryDefn;
  if (cubeFilter instanceof ICubeFilterDefinition) {
    this.cubeFilter=(ICubeFilterDefinition)cubeFilter;
  }
 else {
    this.cubeFilter=new CubeFilterDefinition(this.expr);
  }
  this.aggrLevels=populateAggrLevels();
  axisLevels=this.cubeFilter.getAxisQualifierLevels();
  axisValues=this.cubeFilter.getAxisQualifierValues();
  if (axisLevels == null || axisValues == null || axisLevels.length != axisValues.length) {
    this.isAxisFilter=false;
  }
 else {
    for (int i=0; i < axisLevels.length; i++) {
      if (axisLevels[i] == null)       throw new DataException(ResourceConstants.AXIS_LEVEL_CANNOT_BE_NULL);
      if (axisValues[i] == null)       throw new DataException(ResourceConstants.AXIS_VALUE_CANNOT_BE_NULL,axisLevels[i].getName());
      try {
        axisValues[i]=JavascriptEvalUtil.evaluateRawScript(cx,scope,axisValues[i].toString(),"String_Node_Str",0);
      }
 catch (      BirtException e) {
        throw DataException.wrap(e);
      }
    }
  }
  this.isAxisFilter=(axisLevels != null && axisValues != null && axisLevels.length == axisValues.length);
  if (this.dimName != null) {
    DummyJSDimensionObject dimObj=new DummyJSDimensionObject(this.dimObj,this.getTargetDimensionLevelNames());
    this.scope.put("String_Node_Str",this.scope,new DummyJSDimensionAccessor(this.dimName,dimObj));
  }
  if (this.aggrLevels != null && this.aggrLevels.length > 0) {
    this.scope.put("String_Node_Str",this.scope,this.dataObj);
  }
 else {
    this.scope.put("String_Node_Str",this.scope,new DummyJSDataAccessor(queryDefn.getBindings(),this.scope));
  }
  OLAPExpressionCompiler.compile(cx,this.expr);
}