Program: 69645
Project: 69645
Buggy source:
/** 
 * @param ids
 * @throws BirtException
 * @throws DataException
 */
private void preComplexNestedQuery(List ids) throws BirtException, DataException {
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  deContext2.setTmpdir(this.getTempDir());
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  QueryDefinition qd=new QueryDefinition();
  populateColumnBinding(qd,rowBeArray,totalBeArray);
  qd.setQueryResultsID(this.GEN_queryResultID);
  QueryDefinition qd2=newReportQuery();
  populateColumnBinding(qd2,rowBeArray,totalBeArray);
  ConditionalExpression filterExpr=new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_EQ,"String_Node_Str");
  qd2.addFilter(new FilterDefinition(filterExpr));
  QueryDefinition qd3=newReportQuery();
  populateColumnBinding(qd3,rowBeArray,totalBeArray);
  ConditionalExpression filterExpr1=new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_EQ,"String_Node_Str");
  qd3.addFilter(new FilterDefinition(filterExpr1));
  GroupDefinition gd=new GroupDefinition();
  gd.setKeyColumn("String_Node_Str");
  qd3.addGroup(gd);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  this.UPDATE_queryResultID=qr.getID();
  assertTrue(qr.getResultMetaData() != null);
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  do {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
    this.testPrintln(abc + ri.getRowId());
    qd2.setQueryResultsID(ids.get(0).toString());
    ids.remove(0);
    IQueryResults qr2=myPreDataEngine.prepare(qd2).execute(qr,null);
    IResultIterator subRi1=qr2.getResultIterator();
    while (subRi1.next()) {
      abc="String_Node_Str";
      for (int i=0; i < rowExprName.length; i++)       abc+=subRi1.getValue(rowExprName[i]) + "String_Node_Str";
      this.testPrintln(abc);
      qd3.setQueryResultsID(ids.get(0).toString());
      ids.remove(0);
      IResultIterator subRi2=myPreDataEngine.prepare(qd3).execute(qr2,null).getResultIterator();
      while (subRi2.next()) {
        abc="String_Node_Str";
        for (int i=0; i < rowExprName.length; i++)         abc+=subRi2.getValue(rowExprName[i]) + "String_Node_Str";
        this.testPrintln(abc);
      }
    }
  }
 while (ri.next());
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myPreDataEngine.shutdown();
  this.closeArchiveReader();
  this.closeArchiveWriter();
}

Fixed version (ground truth):
/** 
 * @param ids
 * @throws BirtException
 * @throws DataException
 */
private void preComplexNestedQuery(List ids) throws BirtException, DataException {
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_UPDATE,fileName,fileName);
  deContext2.setTmpdir(this.getTempDir());
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  IBaseExpression[] rowBeArray=getRowExpr();
  IBinding[] totalBeArray=getAggrExpr();
  QueryDefinition qd=new QueryDefinition();
  populateColumnBinding(qd,rowBeArray,totalBeArray);
  qd.setQueryResultsID(this.GEN_queryResultID);
  QueryDefinition qd2=newReportQuery();
  populateColumnBinding(qd2,rowBeArray,totalBeArray);
  ConditionalExpression filterExpr=new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_EQ,"String_Node_Str");
  qd2.addFilter(new FilterDefinition(filterExpr));
  QueryDefinition qd3=newReportQuery();
  populateColumnBinding(qd3,rowBeArray,totalBeArray);
  ConditionalExpression filterExpr1=new ConditionalExpression("String_Node_Str",IConditionalExpression.OP_EQ,"String_Node_Str");
  qd3.addFilter(new FilterDefinition(filterExpr1));
  GroupDefinition gd=new GroupDefinition();
  gd.setKeyColumn("String_Node_Str");
  qd3.addGroup(gd);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  this.UPDATE_queryResultID=qr.getID();
  assertTrue(qr.getResultMetaData() != null);
  IResultIterator ri=qr.getResultIterator();
  ri.next();
  do {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri.getValue(rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri.getValue(totalExprName[i]) + "String_Node_Str";
    this.testPrintln(abc + ri.getRowId());
    qd2.setQueryResultsID(ids.get(0).toString());
    ids.remove(0);
    IQueryResults qr2=myPreDataEngine.prepare(qd2).execute(qr,null);
    IResultIterator subRi1=qr2.getResultIterator();
    while (subRi1.next()) {
      abc="String_Node_Str";
      for (int i=0; i < rowExprName.length; i++)       abc+=subRi1.getValue(rowExprName[i]) + "String_Node_Str";
      this.testPrintln(abc);
      qd3.setQueryResultsID(ids.get(0).toString());
      ids.remove(0);
      IResultIterator subRi2=myPreDataEngine.prepare(qd3).execute(qr2,null).getResultIterator();
      while (subRi2.next()) {
        abc="String_Node_Str";
        for (int i=0; i < rowExprName.length; i++)         abc+=subRi2.getValue(rowExprName[i]) + "String_Node_Str";
        this.testPrintln(abc);
      }
    }
  }
 while (ri.next());
  this.testPrintln("String_Node_Str");
  ri.close();
  qr.close();
  myPreDataEngine.shutdown();
  this.closeArchiveReader();
  this.closeArchiveWriter();
}