Program: 74476
Project: 74476
Buggy source:
/** 
 * @throws BirtException
 */
private void _preBasicIVWithSubQuery() throws BirtException {
  QueryDefinition qd=newPreIVReportQuery();
  qd.setQueryResultsID(this.queryResultID);
  SubqueryDefinition subqueryDefn=new SubqueryDefinition("String_Node_Str",qd);
  ((GroupDefinition)qd.getGroups().get(0)).addSubquery(subqueryDefn);
  subRowExprName=new String[3];
  subRowExprName[0]="String_Node_Str";
  subRowExprName[1]="String_Node_Str";
  subRowExprName[2]="String_Node_Str";
  ScriptExpression[] exprs=new ScriptExpression[3];
  exprs[0]=new ScriptExpression("String_Node_Str");
  exprs[1]=new ScriptExpression("String_Node_Str");
  exprs[2]=new ScriptExpression("String_Node_Str");
  for (int i=0; i < subRowExprName.length; i++)   subqueryDefn.addResultSetExpression(subRowExprName[i],exprs[i]);
  subqueryDefn.setApplyOnGroupFlag(true);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  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());
    IResultIterator subRi=ri.getSecondaryIterator("String_Node_Str",scope);
    while (subRi.next()) {
      abc="String_Node_Str" + subRi.getValue("String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ subRi.getValue("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ subRi.getValue("String_Node_Str")+ "String_Node_Str";
      this.testPrintln(abc);
    }
  }
 while (ri.next());
  ri.close();
  myPreDataEngine.shutdown();
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
private void _preBasicIVWithSubQuery() throws BirtException {
  QueryDefinition qd=newPreIVReportQuery();
  qd.setQueryResultsID(this.queryResultID);
  SubqueryDefinition subqueryDefn=new SubqueryDefinition("String_Node_Str",qd);
  ((GroupDefinition)qd.getGroups().get(0)).addSubquery(subqueryDefn);
  subRowExprName=new String[3];
  subRowExprName[0]="String_Node_Str";
  subRowExprName[1]="String_Node_Str";
  subRowExprName[2]="String_Node_Str";
  ScriptExpression[] exprs=new ScriptExpression[3];
  exprs[0]=new ScriptExpression("String_Node_Str");
  exprs[1]=new ScriptExpression("String_Node_Str");
  exprs[2]=new ScriptExpression("String_Node_Str");
  for (int i=0; i < subRowExprName.length; i++)   subqueryDefn.addResultSetExpression(subRowExprName[i],exprs[i]);
  subqueryDefn.setApplyOnGroupFlag(true);
  IQueryResults qr=myPreDataEngine.prepare(qd).execute(null);
  IResultIterator ri=qr.getResultIterator();
  ri.moveTo(0);
  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());
    IResultIterator subRi=ri.getSecondaryIterator("String_Node_Str",scope);
    while (subRi.next()) {
      abc="String_Node_Str" + subRi.getValue("String_Node_Str") + "String_Node_Str"+ "String_Node_Str"+ subRi.getValue("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ subRi.getValue("String_Node_Str")+ "String_Node_Str"+ "String_Node_Str"+ subRi.getRowId();
      this.testPrintln(abc);
    }
  }
 while (ri.next());
  ri.close();
  myPreDataEngine.shutdown();
}