Program: 67905
Project: 67905
Buggy source:
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  IBaseQueryResults parentQueryResults=null;
  if (parentResult != null) {
    parentQueryResults=parentResult.getQueryResults();
  }
  String resultSetID=loadResultSetID(parentResult,queryID);
  ((QueryDefinition)query).setQueryResultsID(resultSetID);
  processQueryExtensions(query);
  String pRsetId=null;
  String rawId="String_Node_Str";
  String rowId="String_Node_Str";
  IBaseQueryResults dteResults=null;
  QueryResultSet resultSet=null;
  boolean needExecute=queryCache.needExecute(query,queryOwner,useCache);
  if (parentQueryResults == null) {
    if (!needExecute) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      IBasePreparedQuery pQuery=dteSession.prepare(query,null);
      dteResults=dteSession.execute(pQuery,null,context.getScriptContext());
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
      rowId=String.valueOf(((QueryResultSet)parentResult).getRowIndex());
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
      rowId=((CubeResultSet)parentResult).getCellIndex();
    }
    rawId=parentResult.getRawID();
    if (!needExecute) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      IBasePreparedQuery pQuery=dteSession.prepare(query,null);
      dteResults=dteSession.execute(pQuery,parentQueryResults,context.getScriptContext());
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,parentResult,(IQueryDefinition)query,(IQueryResults)dteResults);
  }
  resultSet.setBaseRSetID(resultSetID);
  storeDteMetaInfo(pRsetId,rawId,queryID,dteResults.getID(),rowId);
  return resultSet;
}

Fixed version (ground truth):
protected IBaseResultSet doExecuteQuery(IBaseResultSet parentResult,IQueryDefinition query,Object queryOwner,boolean useCache) throws BirtException {
  String queryID=(String)queryIDMap.get(query);
  IBaseQueryResults parentQueryResults=null;
  if (parentResult != null) {
    parentQueryResults=parentResult.getQueryResults();
  }
  String resultSetID=loadResultSetID(parentResult,queryID);
  ((QueryDefinition)query).setQueryResultsID(resultSetID);
  processQueryExtensions(query);
  String pRsetId=null;
  String rawId="String_Node_Str";
  String rowId="String_Node_Str";
  IBaseQueryResults dteResults=null;
  QueryResultSet resultSet=null;
  boolean needExecute=queryCache.needExecute(query,queryOwner,useCache);
  if (parentQueryResults == null) {
    if (!needExecute) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      IBasePreparedQuery pQuery=dteSession.prepare(query);
      dteResults=dteSession.execute(pQuery,null,context.getScriptContext());
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,query,(IQueryResults)dteResults);
  }
 else {
    if (parentResult instanceof QueryResultSet) {
      pRsetId=((QueryResultSet)parentResult).getQueryResultsID();
      rowId=String.valueOf(((QueryResultSet)parentResult).getRowIndex());
    }
 else {
      pRsetId=((CubeResultSet)parentResult).getQueryResultsID();
      rowId=((CubeResultSet)parentResult).getCellIndex();
    }
    rawId=parentResult.getRawID();
    if (!needExecute) {
      dteResults=getCachedQueryResult(query,parentResult);
    }
    if (dteResults == null) {
      IBasePreparedQuery pQuery=dteSession.prepare(query);
      dteResults=dteSession.execute(pQuery,parentQueryResults,context.getScriptContext());
      putCachedQueryResult(query,dteResults.getID());
    }
    resultSet=new QueryResultSet(this,context,parentResult,(IQueryDefinition)query,(IQueryResults)dteResults);
  }
  resultSet.setBaseRSetID(resultSetID);
  storeDteMetaInfo(pRsetId,rawId,queryID,dteResults.getID(),rowId);
  return resultSet;
}