Program: 69635
Project: 69635
Buggy source:
/** 
 * Basic report document test without sub query, but it has aggregation.
 * @throws Exception 
 */
public void testJointDataSet() throws Exception {
  OdaDataSetDesign dset1=new OdaDataSetDesign("String_Node_Str");
  dset1.setDataSource(this.dataSource.getName());
  dset1.setQueryText("String_Node_Str" + this.getTestTableName());
  dset1.setExtensionID(JDBCOdaDataSource.DATA_SET_TYPE);
  OdaDataSetDesign dset2=new OdaDataSetDesign("String_Node_Str");
  dset2.setDataSource(this.dataSource.getName());
  dset2.setQueryText("String_Node_Str" + this.getTestTableName());
  dset2.setExtensionID(JDBCOdaDataSource.DATA_SET_TYPE);
  List a=new ArrayList();
  a.add(new JoinCondition(new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),IJoinCondition.OP_EQ));
  JointDataSetDesign dset3=new JointDataSetDesign("String_Node_Str",dset1.getName(),dset2.getName(),0,a);
  myGenDataEngine.defineDataSet(dset1);
  myGenDataEngine.defineDataSet(dset2);
  myGenDataEngine.defineDataSet(dset3);
  QueryDefinition query=this.newReportQuery(dset3);
  IBaseExpression[] rowBeArray=new IBaseExpression[6];
  rowBeArray[0]=new ScriptExpression("String_Node_Str");
  rowBeArray[1]=new ScriptExpression("String_Node_Str");
  rowBeArray[2]=new ScriptExpression("String_Node_Str");
  rowBeArray[3]=new ScriptExpression("String_Node_Str");
  rowBeArray[4]=new ScriptExpression("String_Node_Str");
  rowBeArray[5]=new ScriptExpression("String_Node_Str");
  rowExprName=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  prepareExprNameAndQuery(rowExprName,rowBeArray,new String[0],new IBaseExpression[0],query);
  IQueryResults qr=myGenDataEngine.prepare(query).execute(scope);
  saveForPresentation(qr,rowBeArray,new IBaseExpression[0]);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
  }
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.preBasic();
  this.closeArchiveReader();
}

Fixed version (ground truth):
/** 
 * Basic report document test without sub query, but it has aggregation.
 * @throws Exception 
 */
public void testJointDataSet() throws Exception {
  OdaDataSetDesign dset1=new OdaDataSetDesign("String_Node_Str");
  dset1.setDataSource(this.dataSource.getName());
  dset1.setQueryText("String_Node_Str" + this.getTestTableName());
  dset1.setExtensionID(JDBCOdaDataSource.DATA_SET_TYPE);
  OdaDataSetDesign dset2=new OdaDataSetDesign("String_Node_Str");
  dset2.setDataSource(this.dataSource.getName());
  dset2.setQueryText("String_Node_Str" + this.getTestTableName());
  dset2.setExtensionID(JDBCOdaDataSource.DATA_SET_TYPE);
  List a=new ArrayList();
  a.add(new JoinCondition(new ScriptExpression("String_Node_Str"),new ScriptExpression("String_Node_Str"),IJoinCondition.OP_EQ));
  JointDataSetDesign dset3=new JointDataSetDesign("String_Node_Str",dset1.getName(),dset2.getName(),0,a);
  myGenDataEngine.defineDataSet(dset1);
  myGenDataEngine.defineDataSet(dset2);
  myGenDataEngine.defineDataSet(dset3);
  QueryDefinition query=this.newReportQuery(dset3);
  IBaseExpression[] rowBeArray=new IBaseExpression[6];
  rowBeArray[0]=new ScriptExpression("String_Node_Str");
  rowBeArray[1]=new ScriptExpression("String_Node_Str");
  rowBeArray[2]=new ScriptExpression("String_Node_Str");
  rowBeArray[3]=new ScriptExpression("String_Node_Str");
  rowBeArray[4]=new ScriptExpression("String_Node_Str");
  rowBeArray[5]=new ScriptExpression("String_Node_Str");
  rowExprName=new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"};
  for (int i=0; i < rowExprName.length; i++) {
    query.addBinding(new Binding(this.rowExprName[i],rowBeArray[i]));
  }
  IQueryResults qr=myGenDataEngine.prepare(query).execute(scope);
  saveForPresentation(qr);
  IResultIterator ri=qr.getResultIterator();
  while (ri.next()) {
    for (int i=0; i < rowBeArray.length; i++)     expectedValue.add(ri.getValue(rowExprName[i]));
  }
  ri.close();
  qr.close();
  myGenDataEngine.shutdown();
  this.closeArchiveWriter();
  DataEngineContext deContext2=newContext(DataEngineContext.MODE_PRESENTATION,fileName);
  myPreDataEngine=DataEngine.newDataEngine(deContext2);
  this.preBasic();
  this.closeArchiveReader();
}