Program: 68554
Project: 68554
Buggy source:
public void testSelectPhoneNumberNumberWithEmployeeWithExplicitJoin(){
  org.eclipse.persistence.jpa.JpaEntityManager em=(org.eclipse.persistence.jpa.JpaEntityManager)createEntityManager();
  ExpressionBuilder employees=new ExpressionBuilder();
  Expression exp=employees.get("String_Node_Str").equal("String_Node_Str");
  exp=exp.and(employees.get("String_Node_Str").equal("String_Node_Str"));
  Employee emp=(Employee)em.getActiveSession().readAllObjects(Employee.class,exp).firstElement();
  PhoneNumber phone=(PhoneNumber)((Vector)emp.getPhoneNumbers()).firstElement();
  String areaCode=phone.getAreaCode();
  String firstName=emp.getFirstName();
  ExpressionBuilder employeeBuilder=new ExpressionBuilder(Employee.class);
  Expression phones=employeeBuilder.anyOf("String_Node_Str");
  Expression whereClause=phones.get("String_Node_Str").equal(areaCode).and(phones.get("String_Node_Str").get("String_Node_Str").equal(employeeBuilder.get("String_Node_Str")).and(employeeBuilder.get("String_Node_Str").equal(firstName)));
  ReportQuery rq=new ReportQuery();
  rq.addAttribute("String_Node_Str",new ExpressionBuilder().anyOf("String_Node_Str").get("String_Node_Str"));
  rq.setSelectionCriteria(whereClause);
  rq.setReferenceClass(Employee.class);
  Vector expectedResult=getAttributeFromAll("String_Node_Str",(Vector)em.getActiveSession().executeQuery(rq),Employee.class);
  clearCache();
  String ejbqlString;
  ejbqlString="String_Node_Str" + "String_Node_Str" + areaCode + "String_Node_Str"+ firstName+ "String_Node_Str";
  List result=em.createQuery(ejbqlString).getResultList();
  Assert.assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}

Fixed version (ground truth):
public void testSelectPhoneNumberNumberWithEmployeeWithExplicitJoin(){
  org.eclipse.persistence.jpa.JpaEntityManager em=(org.eclipse.persistence.jpa.JpaEntityManager)createEntityManager();
  ExpressionBuilder employees=new ExpressionBuilder();
  Expression exp=employees.get("String_Node_Str").equal("String_Node_Str");
  exp=exp.and(employees.get("String_Node_Str").equal("String_Node_Str"));
  Employee emp=(Employee)em.getActiveSession().readAllObjects(Employee.class,exp).firstElement();
  PhoneNumber phone=(PhoneNumber)((java.util.LinkedList)emp.getPhoneNumbers()).getFirst();
  String areaCode=phone.getAreaCode();
  String firstName=emp.getFirstName();
  ExpressionBuilder employeeBuilder=new ExpressionBuilder(Employee.class);
  Expression phones=employeeBuilder.anyOf("String_Node_Str");
  Expression whereClause=phones.get("String_Node_Str").equal(areaCode).and(phones.get("String_Node_Str").get("String_Node_Str").equal(employeeBuilder.get("String_Node_Str")).and(employeeBuilder.get("String_Node_Str").equal(firstName)));
  ReportQuery rq=new ReportQuery();
  rq.addAttribute("String_Node_Str",new ExpressionBuilder().anyOf("String_Node_Str").get("String_Node_Str"));
  rq.setSelectionCriteria(whereClause);
  rq.setReferenceClass(Employee.class);
  Vector expectedResult=getAttributeFromAll("String_Node_Str",(Vector)em.getActiveSession().executeQuery(rq),Employee.class);
  clearCache();
  String ejbqlString;
  ejbqlString="String_Node_Str" + "String_Node_Str" + areaCode + "String_Node_Str"+ firstName+ "String_Node_Str";
  List result=em.createQuery(ejbqlString).getResultList();
  Assert.assertTrue("String_Node_Str",comparer.compareObjects(result,expectedResult));
}