Program: 67774
Project: 67774
Buggy source:
public ICubeCursor getCubeCursor() throws DataException {
  if (this.cubeCursor != null)   return this.cubeCursor;
  try {
    stopSign.start();
    CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
    executor.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
    BirtCubeView bcv=new BirtCubeView(executor,appContext);
    IDocumentManager documentManager=getDocumentManager(executor);
    ICube cube=loadCube(documentManager,executor);
    CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube,true);
    ICubeQueryDefinition baseQuery=cubeQueryDefinition;
    DrillQueryHelper helper=new DrillQueryHelper(outResults,baseQuery,cube,session,scope,context,appContext,stopSign);
    if (helper.getAllCubeViews().length > 0) {
      BirtCubeView view=findBaseView(bcv,helper.getAllCubeViews());
      cubeCursor=new MergedCubeCursor(cubeCursor,bcv,view,helper);
      baseQuery=view.getCubeQueryDefinition();
    }
    cube.close();
    String newResultSetId=executor.getQueryResultsId();
    if (newResultSetId != null) {
      this.queryResultsId=newResultSetId;
    }
    this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor,bcv.getMeasureMapping()));
    this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(baseQuery,bcv));
    this.cubeCursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
    return this.cubeCursor;
  }
 catch (  OLAPException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public ICubeCursor getCubeCursor() throws DataException {
  if (this.cubeCursor != null)   return this.cubeCursor;
  try {
    stopSign.start();
    CubeQueryExecutor executor=new CubeQueryExecutor(this.outResults,cubeQueryDefinition,this.session,this.scope,this.context);
    executor.getFacttableBasedFilterHelpers().addAll(this.preparedQuery.getInternalFilters());
    IDocumentManager documentManager=getDocumentManager(executor);
    ICube cube=loadCube(documentManager,executor);
    BirtCubeView bcv=new BirtCubeView(executor,cube,appContext);
    CubeCursor cubeCursor=bcv.getCubeCursor(stopSign,cube,true);
    ICubeQueryDefinition baseQuery=cubeQueryDefinition;
    DrillQueryHelper helper=new DrillQueryHelper(outResults,baseQuery,cube,session,scope,context,appContext,stopSign);
    if (helper.getAllCubeViews().length > 0) {
      BirtCubeView view=findBaseView(bcv,helper.getAllCubeViews());
      cubeCursor=new MergedCubeCursor(cubeCursor,bcv,view,helper);
      baseQuery=view.getCubeQueryDefinition();
    }
    cube.close();
    String newResultSetId=executor.getQueryResultsId();
    if (newResultSetId != null) {
      this.queryResultsId=newResultSetId;
    }
    this.scope.put(ScriptConstants.MEASURE_SCRIPTABLE,this.scope,new JSMeasureAccessor(cubeCursor,bcv.getMeasureMapping()));
    this.scope.put(ScriptConstants.DIMENSION_SCRIPTABLE,this.scope,new JSLevelAccessor(baseQuery,bcv));
    this.cubeCursor=new CubeCursorImpl(outResults,cubeCursor,this.scope,session.getEngineContext().getScriptContext(),cubeQueryDefinition,bcv);
    return this.cubeCursor;
  }
 catch (  OLAPException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
catch (  IOException e) {
    throw new DataException(e.getLocalizedMessage(),e);
  }
}