Program: 69625
Project: 69625
Buggy source:
/** 
 * @throws BirtException
 */
public void testBasicFooter() throws BirtException {
  int countOfRow=8;
  List genValue=null;
{
    QueryDefinition qd=newReportQuery();
    IBaseExpression[] rowBeArray=getRowExpr();
    IBaseExpression[] totalBeArray=getAggrExpr();
    rowExprName=getRowExprName();
    totalExprName=getAggrExprName();
    prepareExprNameAndQuery(rowExprName,rowBeArray,totalExprName,totalBeArray,qd);
    IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
    saveForPresentation(qr,rowBeArray,totalBeArray);
    IResultIterator ri=qr.getResultIterator();
    int currRow=-1;
    while (ri.next()) {
      currRow++;
      if (currRow == countOfRow - 1) {
        genValue=new ArrayList();
        for (int i=0; i < rowBeArray.length; i++)         genValue.add(ri.getValue(rowExprName[i]));
        for (int i=0; i < totalBeArray.length; i++)         genValue.add(ri.getValue(totalExprName[i]));
      }
    }
    ri.close();
    ri.close();
    qr.close();
    qr.close();
    myGenDataEngine.shutdown();
  }
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  List preValue=null;
{
    IQueryResults qr=myPreDataEngine.getQueryResults(queryResultID);
    IResultIterator ri=qr.getResultIterator();
    ri.moveTo(countOfRow - 1);
    preValue=new ArrayList();
    if (rowExprName != null) {
      for (int i=0; i < rowExprName.length; i++) {
        Object ob2=ri.getValue(rowExprName[i]);
        preValue.add(ob2);
      }
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob2=ri.getValue(totalExprName[i]);
        preValue.add(ob2);
      }
    }
    ri.close();
    myPreDataEngine.shutdown();
    this.closeArchiveReader();
  }
  Iterator it1=genValue.iterator();
  Iterator it2=preValue.iterator();
  String str="String_Node_Str";
  while (it1.hasNext()) {
    Object ob2=it2.next();
    assertTrue(it1.next().equals(ob2));
    str+=ob2.toString() + "String_Node_Str";
  }
  System.out.println("String_Node_Str" + str);
}

Fixed version (ground truth):
/** 
 * @throws BirtException
 */
public void testBasicFooter() throws BirtException {
  int countOfRow=8;
  List genValue=null;
{
    QueryDefinition qd=newReportQuery();
    IBaseExpression[] rowBeArray=getRowExpr();
    IBaseExpression[] totalBeArray=getAggrExpr();
    rowExprName=getRowExprName();
    totalExprName=getAggrExprName();
    prepareExprNameAndQuery(qd);
    IQueryResults qr=myGenDataEngine.prepare(qd).execute(scope);
    saveForPresentation(qr);
    IResultIterator ri=qr.getResultIterator();
    int currRow=-1;
    while (ri.next()) {
      currRow++;
      if (currRow == countOfRow - 1) {
        genValue=new ArrayList();
        for (int i=0; i < rowBeArray.length; i++)         genValue.add(ri.getValue(rowExprName[i]));
        for (int i=0; i < totalBeArray.length; i++)         genValue.add(ri.getValue(totalExprName[i]));
      }
    }
    ri.close();
    ri.close();
    qr.close();
    qr.close();
    myGenDataEngine.shutdown();
  }
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  List preValue=null;
{
    IQueryResults qr=myPreDataEngine.getQueryResults(queryResultID);
    IResultIterator ri=qr.getResultIterator();
    ri.moveTo(countOfRow - 1);
    preValue=new ArrayList();
    if (rowExprName != null) {
      for (int i=0; i < rowExprName.length; i++) {
        Object ob2=ri.getValue(rowExprName[i]);
        preValue.add(ob2);
      }
    }
    if (totalExprName != null) {
      for (int i=0; i < totalExprName.length; i++) {
        Object ob2=ri.getValue(totalExprName[i]);
        preValue.add(ob2);
      }
    }
    ri.close();
    myPreDataEngine.shutdown();
    this.closeArchiveReader();
  }
  Iterator it1=genValue.iterator();
  Iterator it2=preValue.iterator();
  String str="String_Node_Str";
  while (it1.hasNext()) {
    Object ob2=it2.next();
    assertTrue(it1.next().equals(ob2));
    str+=ob2.toString() + "String_Node_Str";
  }
  System.out.println("String_Node_Str" + str);
}