Program: 73486
Project: 73486
Buggy source:
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  IBaseQueryResults parentQueryResults=null;
  if (parentResult != null) {
    parentQueryResults=parentResult.getQueryResults();
  }
  String resultSetID=loadResultSetID(parentResult,queryID);
  if (resultSetID == null) {
    throw new EngineException("String_Node_Str" + query.getClass().getName());
  }
  ((QueryDefinition)query).setQueryResultsID(resultSetID);
  IBasePreparedQuery pQuery=dteSession.prepare(query,null);
  Scriptable scope=context.getSharedScope();
  String pRsetId=null;
  String rowId="String_Node_Str";
  IBaseQueryResults dteResults=null;
  QueryResultSet resultSet=null;
  if (parentQueryResults == null) {
    if (useCache) {
      dteResults=getCachedQueryResult(query);
    }
    if (dteResults == null) {
      dteResults=dteSession.execute(pQuery,null,scope);
      if (query.cacheQueryResults()) {
        cachedQueryToResults.put(query,dteResults.getID());
      }
    }
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    rowId=parentResult.getRawID();
    if (useCache) {
      dteResults=getCachedQueryResult(query);
    }
    if (dteResults == null) {
      dteResults=dteSession.execute(pQuery,parentQueryResults,scope);
      if (query.cacheQueryResults()) {
        cachedQueryToResults.put(query,dteResults.getID());
      }
    }
    resultSet=new QueryResultSet(this,context,parentResult,(IQueryDefinition)query,(IQueryResults)dteResults);
  }
  resultSet.setBaseRSetID(resultSetID);
  storeDteMetaInfo(pRsetId,rowId,queryID,dteResults.getID());
  return resultSet;
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  IBaseQueryResults parentQueryResults=null;
  if (parentResult != null) {
    parentQueryResults=parentResult.getQueryResults();
  }
  String resultSetID=loadResultSetID(parentResult,queryID);
  if (resultSetID == null) {
    throw new EngineException("String_Node_Str" + query.getClass().getName());
  }
  ((QueryDefinition)query).setQueryResultsID(resultSetID);
  IBasePreparedQuery pQuery=dteSession.prepare(query,null);
  Scriptable scope=context.getSharedScope();
  String pRsetId=null;
  String rowId="String_Node_Str";
  IBaseQueryResults dteResults=null;
  QueryResultSet resultSet=null;
  if (parentQueryResults == null) {
    if (useCache) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      dteResults=dteSession.execute(pQuery,null,scope);
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
    }
    rowId=parentResult.getRawID();
    if (useCache) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      dteResults=dteSession.execute(pQuery,parentQueryResults,scope);
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,parentResult,(IQueryDefinition)query,(IQueryResults)dteResults);
  }
  resultSet.setBaseRSetID(resultSetID);
  storeDteMetaInfo(pRsetId,rowId,queryID,dteResults.getID());
  return resultSet;
}