Program: 72648
Project: 72648
Buggy source:
private IAggregationResultSet[] populateRs(CubeQueryExecutor executor,AggregationDefinition[] aggrDefns,CubeQueryExecutorHelper cubeQueryExcutorHelper2,MeasureNameManager manager,StopSign stopSign,boolean saveToRD) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  String id=null;
  if (executor.getCubeQueryDefinition().getQueryResultsID() == null) {
    rs=cubeQueryExcutorHelper.execute(aggrDefns,new StopSign());
    CubeOperationsExecutor coe=new CubeOperationsExecutor(executor.getCubeQueryDefinition(),executor.getSession().getSharedScope());
    rs=coe.execute(rs,manager,stopSign);
    if (executor.getCubeQueryDefinition().cacheQueryResults()) {
      id=QueryResultIDUtil.nextID();
      File tmpDir=new File(executor.getSession().getTempDir());
      if (!tmpDir.exists() || !tmpDir.isDirectory()) {
        tmpDir.mkdirs();
      }
      ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
      AggregationResultSetSaveUtil.save(id,rs,writer);
      writer.finish();
    }
    if (saveToRD) {
      if (id != null) {
        AggregationResultSetSaveUtil.save(id,rs,executor.getContext().getDocWriter());
      }
 else {
        id=QueryResultIDUtil.nextID();
        AggregationResultSetSaveUtil.save(id,rs,executor.getContext().getDocWriter());
      }
    }
  }
 else {
    id=executor.getCubeQueryDefinition().getQueryResultsID();
    rs=AggregationResultSetSaveUtil.load(id,new FileArchiveReader(executor.getSession().getTempDir() + "String_Node_Str"),VersionManager.getLatestVersion());
  }
  executor.setQueryResultsId(id);
  return rs;
}

Fixed version (ground truth):
private IAggregationResultSet[] populateRs(CubeQueryExecutor executor,AggregationDefinition[] aggrDefns,CubeQueryExecutorHelper cubeQueryExcutorHelper2,MeasureNameManager manager,StopSign stopSign,boolean saveToRD) throws IOException, BirtException {
  IAggregationResultSet[] rs;
  String id=null;
  if (executor.getCubeQueryDefinition().getQueryResultsID() == null) {
    rs=cubeQueryExcutorHelper.execute(aggrDefns,new StopSign());
    CubeOperationsExecutor coe=new CubeOperationsExecutor(executor.getCubeQueryDefinition(),executor.getSession().getSharedScope());
    rs=coe.execute(rs,manager,stopSign);
    if (executor.getCubeQueryDefinition().cacheQueryResults()) {
      id=executor.getSession().getQueryResultIDUtil().nextID();
      File tmpDir=new File(executor.getSession().getTempDir());
      if (!tmpDir.exists() || !tmpDir.isDirectory()) {
        tmpDir.mkdirs();
      }
      ArchiveWriter writer=new ArchiveWriter(new ArchiveFile(executor.getSession().getTempDir() + "String_Node_Str","String_Node_Str"));
      AggregationResultSetSaveUtil.save(id,rs,writer);
      writer.finish();
    }
    if (saveToRD) {
      if (id != null) {
        AggregationResultSetSaveUtil.save(id,rs,executor.getContext().getDocWriter());
      }
 else {
        id=executor.getSession().getQueryResultIDUtil().nextID();
        AggregationResultSetSaveUtil.save(id,rs,executor.getContext().getDocWriter());
      }
    }
  }
 else {
    id=executor.getCubeQueryDefinition().getQueryResultsID();
    rs=AggregationResultSetSaveUtil.load(id,new FileArchiveReader(executor.getSession().getTempDir() + "String_Node_Str"),VersionManager.getLatestVersion());
  }
  executor.setQueryResultsId(id);
  return rs;
}