Program: 69648
Project: 69648
Buggy source:
/** 
 * @return
 * @throws BirtException
 */
private List genComplexNestedQuery() throws BirtException {
  QueryDefinition qd1=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBaseExpression[] totalBeArray=getAggrExpr();
  populateColumnBinding(qd1,rowBeArray,totalBeArray);
  IQueryResults qr1=myGenDataEngine.prepare(qd1).execute(scope);
  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));
  IPreparedQuery preparedQuery2=myGenDataEngine.prepare(qd2);
  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));
  IPreparedQuery preparedQuery3=myGenDataEngine.prepare(qd3);
  GEN_queryResultID=qr1.getID();
  List nestedQueryResultId=new ArrayList();
  IResultIterator ri1=qr1.getResultIterator();
  while (ri1.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri1.getValue(this.rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri1.getValue(this.totalExprName[i]) + "String_Node_Str";
    this.testPrintln(abc);
    IQueryResults qr2=preparedQuery2.execute(qr1,scope);
    nestedQueryResultId.add(qr2.getID());
    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);
      IQueryResults qr3=preparedQuery3.execute(qr2,scope);
      nestedQueryResultId.add(qr3.getID());
      IResultIterator subRi2=qr3.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);
      }
      subRi2.close();
    }
    subRi1.close();
  }
  this.testPrintln("String_Node_Str");
  ri1.close();
  qr1.close();
  myGenDataEngine.shutdown();
  this.closeArchiveWriter();
  return nestedQueryResultId;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws BirtException
 */
private List genComplexNestedQuery() throws BirtException {
  QueryDefinition qd1=newReportQuery();
  IBaseExpression[] rowBeArray=getRowExpr();
  IBinding[] totalBeArray=getAggrExpr();
  populateColumnBinding(qd1,rowBeArray,totalBeArray);
  IQueryResults qr1=myGenDataEngine.prepare(qd1).execute(scope);
  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));
  IPreparedQuery preparedQuery2=myGenDataEngine.prepare(qd2);
  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));
  IPreparedQuery preparedQuery3=myGenDataEngine.prepare(qd3);
  GEN_queryResultID=qr1.getID();
  List nestedQueryResultId=new ArrayList();
  IResultIterator ri1=qr1.getResultIterator();
  while (ri1.next()) {
    String abc="String_Node_Str";
    for (int i=0; i < rowExprName.length; i++)     abc+=ri1.getValue(this.rowExprName[i]) + "String_Node_Str";
    for (int i=0; i < totalExprName.length; i++)     abc+=ri1.getValue(this.totalExprName[i]) + "String_Node_Str";
    this.testPrintln(abc);
    IQueryResults qr2=preparedQuery2.execute(qr1,scope);
    nestedQueryResultId.add(qr2.getID());
    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);
      IQueryResults qr3=preparedQuery3.execute(qr2,scope);
      nestedQueryResultId.add(qr3.getID());
      IResultIterator subRi2=qr3.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);
      }
      subRi2.close();
    }
    subRi1.close();
  }
  this.testPrintln("String_Node_Str");
  ri1.close();
  qr1.close();
  myGenDataEngine.shutdown();
  this.closeArchiveWriter();
  return nestedQueryResultId;
}