Program: 64896
Project: 64896
Buggy source:
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=QueryExecutorUtil.applyFilterOnOperation(view,cubeQueryExecutorHelper,executor,aggrDefns,rs,fetcher,executor.getSession().getStopSign());
  rs=noUpdateFilterHelper.applyNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters(),executor,rs,view.getCube(),fetcher,false);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  QueryExecutorUtil.validateLimitSetting(view,rs);
  rs=this.processNestedAggrOperation(executor,view,executor.getSession().getStopSign(),rs,fetcher);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    File tmpDir=new File(executor.getSession().getTempDir());
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] executeQuery(BirtCubeView view,AggregationDefinition[] aggrDefns,boolean saveToRD,String queryResutID,IBindingValueFetcher fetcher) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  CubeQueryExecutor executor=view.getCubeQueryExecutor();
  rs=cubeQueryExecutorHelper.execute(aggrDefns,executor.getSession().getStopSign());
  rs=QueryExecutorUtil.applyFilterOnOperation(view,cubeQueryExecutorHelper,executor,aggrDefns,rs,fetcher,executor.getSession().getStopSign());
  rs=noUpdateFilterHelper.applyNoAggrUpdateFilters(executor.getCubeQueryDefinition().getFilters(),executor,rs,view.getCube(),fetcher,false);
  MirrorOperationExecutor moe=new MirrorOperationExecutor();
  rs=moe.execute(rs,view,cubeQueryExecutorHelper);
  QueryExecutorUtil.validateLimitSetting(view,rs);
  rs=this.processNestedAggrOperation(executor,view,executor.getSession().getStopSign(),rs,fetcher);
  if (executor.getCubeQueryDefinition().cacheQueryResults()) {
    String tmpDirPath=executor.getSession().getTempDir();
    File tmpDir=new File(tmpDirPath);
    if (!FileSecurity.fileExist(tmpDir) || !FileSecurity.fileIsDirectory(tmpDir)) {
      FileSecurity.fileMakeDirs(tmpDir);
    }
    ArchiveFile aFile=new ArchiveFile(tmpDirPath + "String_Node_Str","String_Node_Str");
    ArchiveWriter writer=new ArchiveWriter(aFile);
    AggregationResultSetSaveUtil.save(queryResutID,rs,writer);
    writer.finish();
    aFile.close();
  }
  if (saveToRD) {
    CubeQueryDefinitionIOUtil.save(queryResutID,executor.getContext(),executor.getCubeQueryDefinition());
    AggregationResultSetSaveUtil.save(queryResutID,rs,executor.getContext().getDocWriter());
  }
  return rs;
}