Program: 69647
Project: 69647
Buggy source:
/** 
 * @return
 * @throws BirtException
 */
private List genBasicNestedQuery() 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 preparedQuery=myGenDataEngine.prepare(qd2);
  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 qr=preparedQuery.execute(qr1,scope);
    nestedQueryResultId.add(qr.getID());
    IResultIterator subRi=qr.getResultIterator();
    while (subRi.next()) {
      abc="String_Node_Str";
      for (int i=0; i < rowExprName.length; i++) {
        abc+=subRi.getValue(rowExprName[i]) + "String_Node_Str";
      }
      this.testPrintln(abc);
    }
    subRi.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 genBasicNestedQuery() 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 preparedQuery=myGenDataEngine.prepare(qd2);
  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 qr=preparedQuery.execute(qr1,scope);
    nestedQueryResultId.add(qr.getID());
    IResultIterator subRi=qr.getResultIterator();
    while (subRi.next()) {
      abc="String_Node_Str";
      for (int i=0; i < rowExprName.length; i++) {
        abc+=subRi.getValue(rowExprName[i]) + "String_Node_Str";
      }
      this.testPrintln(abc);
    }
    subRi.close();
  }
  this.testPrintln("String_Node_Str");
  ri1.close();
  qr1.close();
  myGenDataEngine.shutdown();
  this.closeArchiveWriter();
  return nestedQueryResultId;
}