nus-yam/ex-repair huggingface dataset:
Program: 63349
Project: 63349
Buggy source:
public void testTimeStampTZ(){
  int year=2000, month=1, date=10, hour=0, minute=0, second=0;
  Integer tsId=null;
  Calendar originalCal=null, dbCal=null;
  String zoneId="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneId));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,0,0,0);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
    closeEntityManager(em);
    clearCache();
    em=createEntityManager("String_Node_Str");
    dbCal=em.find(TStamp.class,tsId).getTsTZ();
    assertEquals("String_Node_Str",dbCal.getTimeZone().getID(),zoneId);
    assertTrue("String_Node_Str",Calendar.AM == dbCal.get(java.util.Calendar.AM_PM));
    assertTrue("String_Node_Str",year == dbCal.get(java.util.Calendar.YEAR));
    assertTrue("String_Node_Str",month == dbCal.get(java.util.Calendar.MONTH));
    assertTrue("String_Node_Str",date == dbCal.get(java.util.Calendar.DATE));
    assertTrue("String_Node_Str",hour == dbCal.get(java.util.Calendar.HOUR));
    assertTrue("String_Node_Str",minute == dbCal.get(java.util.Calendar.MINUTE));
    assertTrue("String_Node_Str",second == dbCal.get(java.util.Calendar.SECOND));
  }
  finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
public void testTimeStampTZ(){
  int year=2000, month=1, date=10, hour=0, minute=0, second=0;
  Integer tsId;
  Calendar originalCal, dbCal;
  String zoneId="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneId));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,0,0,0);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
    closeEntityManager(em);
    clearCache();
    em=createEntityManager("String_Node_Str");
    dbCal=em.find(TStamp.class,tsId).getTsTZ();
    assertEquals("String_Node_Str",dbCal.getTimeZone().getID(),zoneId);
    assertEquals("String_Node_Str",Calendar.AM,dbCal.get(Calendar.AM_PM));
    assertEquals("String_Node_Str",year,dbCal.get(Calendar.YEAR));
    assertEquals("String_Node_Str",month,dbCal.get(Calendar.MONTH));
    assertEquals("String_Node_Str",date,dbCal.get(Calendar.DATE));
    assertEquals("String_Node_Str",hour,dbCal.get(Calendar.HOUR));
    assertEquals("String_Node_Str",minute,dbCal.get(Calendar.MINUTE));
    assertEquals("String_Node_Str",second,dbCal.get(Calendar.SECOND));
  }
  finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 63350
Project: 63350
Buggy source:
public void testTimeStampLTZ(){
  int year=2000, month=3, date=21, hour=11, minute=45, second=50;
  Integer tsId=null;
  Calendar originalCal=null, dbCal=null;
  String zoneId="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneId));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,hour,minute,second);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsLTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
  }
 catch (  Exception e) {
    e.printStackTrace();
    rollbackTransaction(em);
  }
 finally {
    clearCache();
    dbCal=em.find(TStamp.class,tsId).getTsLTZ();
    closeEntityManager(em);
  }
  assertTrue("String_Node_Str",year == dbCal.get(java.util.Calendar.YEAR));
  assertTrue("String_Node_Str",month == dbCal.get(java.util.Calendar.MONTH));
  assertTrue("String_Node_Str",date == dbCal.get(java.util.Calendar.DATE));
  int hourDiffFromDB=dbCal.get(Calendar.HOUR_OF_DAY) - originalCal.get(Calendar.HOUR_OF_DAY);
  int hourDiffFromZone=(dbCal.get(Calendar.ZONE_OFFSET) - originalCal.get(Calendar.ZONE_OFFSET)) / 3600000;
  assertTrue("String_Node_Str",hourDiffFromDB == hourDiffFromZone);
  assertTrue("String_Node_Str",minute == dbCal.get(java.util.Calendar.MINUTE));
  assertTrue("String_Node_Str",second == dbCal.get(java.util.Calendar.SECOND));
}

Fixed version (ground truth):
public void testTimeStampLTZ(){
  int year=2000, month=3, date=21, hour=11, minute=45, second=50;
  Integer tsId=null;
  Calendar originalCal=null, dbCal;
  String zoneId="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneId));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,hour,minute,second);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsLTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
  }
 catch (  Exception e) {
    e.printStackTrace();
    rollbackTransaction(em);
    throw e;
  }
 finally {
    clearCache();
    dbCal=em.find(TStamp.class,tsId).getTsLTZ();
    closeEntityManager(em);
  }
  dbCal.setTimeZone(TimeZone.getTimeZone(zoneId));
  assertEquals("String_Node_Str",year,dbCal.get(Calendar.YEAR));
  assertEquals("String_Node_Str",month,dbCal.get(Calendar.MONTH));
  assertEquals("String_Node_Str",date,dbCal.get(Calendar.DATE));
  assertEquals("String_Node_Str",originalCal.get(Calendar.HOUR_OF_DAY),dbCal.get(Calendar.HOUR_OF_DAY));
  assertEquals("String_Node_Str",minute,dbCal.get(Calendar.MINUTE));
  assertEquals("String_Node_Str",second,dbCal.get(Calendar.SECOND));
}
Program: 63351
Project: 63351
Buggy source:
public void testTimeStampTZDST(){
  int year=2008, month=2, date=10, hour=11, minute=0, second=0;
  Integer tsId=null;
  Calendar originalCal=null, dbCal=null;
  String zoneIdRemote="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneIdRemote));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,hour,minute,second);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsLTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
    closeEntityManager(em);
    clearCache();
    em=createEntityManager("String_Node_Str");
    dbCal=em.find(TStamp.class,tsId).getTsLTZ();
    int hourDiffFromDB=dbCal.get(Calendar.HOUR_OF_DAY) - originalCal.get(Calendar.HOUR_OF_DAY);
    int hourDiffFromZone=(dbCal.get(Calendar.ZONE_OFFSET) - originalCal.get(Calendar.ZONE_OFFSET)) / 3600000;
    assertTrue("String_Node_Str",(hourDiffFromZone + dbCal.get(Calendar.DST_OFFSET) / 3600000) == hourDiffFromDB);
  }
  finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
public void testTimeStampTZDST(){
  int year=2008, month=2, date=10, hour=11, minute=0, second=0;
  Integer tsId;
  Calendar originalCal, dbCal;
  String zoneIdRemote="String_Node_Str";
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance(TimeZone.getTimeZone(zoneIdRemote));
    originalCal.set(Calendar.AM_PM,Calendar.AM);
    originalCal.set(year,month,date,hour,minute,second);
    originalCal.set(Calendar.MILLISECOND,0);
    ts.setTsLTZ(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
    closeEntityManager(em);
    clearCache();
    em=createEntityManager("String_Node_Str");
    dbCal=em.find(TStamp.class,tsId).getTsLTZ();
    int hourDiffFromDB=dbCal.get(Calendar.HOUR_OF_DAY) - originalCal.get(Calendar.HOUR_OF_DAY);
    int hourDiffFromZone=(dbCal.get(Calendar.ZONE_OFFSET) - originalCal.get(Calendar.ZONE_OFFSET)) / 3600000;
    assertEquals("String_Node_Str",(hourDiffFromZone + dbCal.get(Calendar.DST_OFFSET) / 3600000),hourDiffFromDB);
  }
  finally {
    if (isTransactionActive(em)) {
      rollbackTransaction(em);
    }
    closeEntityManager(em);
  }
}
Program: 63352
Project: 63352
Buggy source:
public void testNoZone(){
  int year=2000, month=1, date=10, hour=11, minute=21, second=31;
  Integer tsId=null;
  java.util.Calendar originalCal=null, dbCal=null;
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=java.util.Calendar.getInstance();
    originalCal.set(year,month,date,hour,minute,second);
    ts.setNoZone(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
  }
 catch (  Exception e) {
    e.printStackTrace();
    rollbackTransaction(em);
  }
 finally {
    clearCache();
    dbCal=em.find(TStamp.class,tsId).getNoZone();
    closeEntityManager(em);
  }
  assertEquals("String_Node_Str",dbCal,originalCal);
  assertTrue("String_Node_Str",year == dbCal.get(java.util.Calendar.YEAR));
  assertTrue("String_Node_Str",month == dbCal.get(java.util.Calendar.MONTH));
  assertTrue("String_Node_Str",date == dbCal.get(java.util.Calendar.DATE));
  assertTrue("String_Node_Str",hour == dbCal.get(java.util.Calendar.HOUR));
  assertTrue("String_Node_Str",minute == dbCal.get(java.util.Calendar.MINUTE));
  assertTrue("String_Node_Str",second == dbCal.get(java.util.Calendar.SECOND));
}

Fixed version (ground truth):
public void testNoZone(){
  int year=2000, month=1, date=10, hour=11, minute=21, second=31;
  Integer tsId=null;
  Calendar originalCal=null, dbCal;
  EntityManager em=createEntityManager("String_Node_Str");
  beginTransaction(em);
  try {
    TStamp ts=new TStamp();
    originalCal=Calendar.getInstance();
    originalCal.set(year,month,date,hour,minute,second);
    ts.setNoZone(originalCal);
    em.persist(ts);
    em.flush();
    tsId=ts.getId();
    commitTransaction(em);
  }
 catch (  Exception e) {
    e.printStackTrace();
    rollbackTransaction(em);
  }
 finally {
    clearCache();
    dbCal=em.find(TStamp.class,tsId).getNoZone();
    closeEntityManager(em);
  }
  assertEquals("String_Node_Str",dbCal,originalCal);
  assertEquals("String_Node_Str",year,dbCal.get(Calendar.YEAR));
  assertEquals("String_Node_Str",month,dbCal.get(Calendar.MONTH));
  assertEquals("String_Node_Str",date,dbCal.get(Calendar.DATE));
  assertEquals("String_Node_Str",hour,dbCal.get(Calendar.HOUR));
  assertEquals("String_Node_Str",minute,dbCal.get(Calendar.MINUTE));
  assertEquals("String_Node_Str",second,dbCal.get(Calendar.SECOND));
}
Program: 63353
Project: 63353
Buggy source:
/** 
 * Finalize.
 */
@Override public void finalize(){
  this.emf.close();
  this.emf=null;
  this.jaxbContext=null;
}

Fixed version (ground truth):
/** 
 * Finalize.
 */
@Override protected void finalize() throws Throwable {
  emf.close();
  super.finalize();
}
Program: 63354
Project: 63354
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildSingleResultQueryResponse(PersistenceContext context,Map<String,Object> queryParams,Object result,List<ReportItem> items,UriInfo uriInfo){
  final SingleResultQueryList response=new SingleResultQueryList();
  final List<JAXBElement> fields=new FeatureResponseBuilderImpl().createShellJAXBElementList(items,result);
  if (fields == null) {
    return null;
  }
  response.setFields(fields);
  return response;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object buildSingleResultQueryResponse(PersistenceContext context,Map<String,Object> queryParams,Object result,List<ReportItem> items,UriInfo uriInfo){
  final SingleResultQueryList response=new SingleResultQueryList();
  final List<JAXBElement> fields=new FeatureResponseBuilderImpl().createShellJAXBElementList(items,result);
  response.setFields(fields);
  return response;
}
Program: 63355
Project: 63355
Buggy source:
private ReportQueryResultList populateReportQueryResultList(List<Object[]> results,List<ReportItem> reportItems){
  ReportQueryResultList response=new ReportQueryResultList();
  for (  Object result : results) {
    ReportQueryResultListItem queryResultListItem=new ReportQueryResultListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(reportItems,result);
    if (jaxbFields == null) {
      return null;
    }
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  return response;
}

Fixed version (ground truth):
private ReportQueryResultList populateReportQueryResultList(List<Object[]> results,List<ReportItem> reportItems){
  ReportQueryResultList response=new ReportQueryResultList();
  for (  Object result : results) {
    ReportQueryResultListItem queryResultListItem=new ReportQueryResultListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(reportItems,result);
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  return response;
}
Program: 63356
Project: 63356
Buggy source:
/** 
 * Creates the shell jaxb element list.
 * @param reportItems the report items
 * @param record the record
 * @return the list
 */
public List<JAXBElement> createShellJAXBElementList(List<ReportItem> reportItems,Object record){
  List<JAXBElement> jaxbElements=new ArrayList<JAXBElement>(reportItems.size());
  if ((reportItems != null) && (reportItems.size() > 0)) {
    for (int index=0; index < reportItems.size(); index++) {
      ReportItem reportItem=reportItems.get(index);
      Object reportItemValue=record;
      if (record instanceof Object[]) {
        reportItemValue=((Object[])record)[index];
      }
      Class reportItemValueType=null;
      if (reportItemValue != null) {
        reportItemValueType=reportItemValue.getClass();
        if (reportItemValueType == null) {
          DatabaseMapping dbMapping=reportItem.getMapping();
          if (dbMapping != null) {
            reportItemValueType=dbMapping.getAttributeClassification();
          }
 else {
            ClassDescriptor desc=reportItem.getDescriptor();
            if (desc != null) {
              reportItemValueType=desc.getJavaClass();
            }
          }
        }
        JAXBElement element=new JAXBElement(new QName(reportItem.getName()),reportItemValueType,reportItemValue);
        jaxbElements.add(reportItem.getResultIndex(),element);
      }
    }
  }
  return jaxbElements;
}

Fixed version (ground truth):
/** 
 * Creates the shell jaxb element list.
 * @param reportItems the report items
 * @param record the record
 * @return the list. Returns an empty list if reportItems is null or empty.
 */
public List<JAXBElement> createShellJAXBElementList(List<ReportItem> reportItems,Object record){
  if (reportItems == null || reportItems.size() == 0) {
    return Collections.emptyList();
  }
  List<JAXBElement> jaxbElements=new ArrayList<>(reportItems.size());
  for (int index=0; index < reportItems.size(); index++) {
    ReportItem reportItem=reportItems.get(index);
    Object reportItemValue=record;
    if (record instanceof Object[]) {
      reportItemValue=((Object[])record)[index];
    }
    if (reportItemValue != null) {
      JAXBElement element=new JAXBElement(new QName(reportItem.getName()),reportItemValue.getClass(),reportItemValue);
      jaxbElements.add(reportItem.getResultIndex(),element);
    }
  }
  return jaxbElements;
}
Program: 63357
Project: 63357
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public SessionEventListener getSessionEventListener(AbstractSession session){
  return new PreLoginMappingAdapterV2(session);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SessionEventListener getSessionEventListener(AbstractSession session){
  return new PreLoginMappingAdapterV2();
}
Program: 63358
Project: 63358
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildSingleResultQueryResponse(PersistenceContext context,Map<String,Object> queryParams,Object result,List<ReportItem> items,UriInfo uriInfo){
  final SingleResultQueryResult response=new SingleResultQueryResult();
  final List<JAXBElement> fields=createShellJAXBElementList(items,result);
  if (fields == null) {
    return null;
  }
  generateLinksInElementsList(context,fields);
  response.setFields(fields);
  response.addLink(new LinkV2(ReservedWords.JPARS_REL_SELF,uriInfo.getRequestUri().toString()));
  return response;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object buildSingleResultQueryResponse(PersistenceContext context,Map<String,Object> queryParams,Object result,List<ReportItem> items,UriInfo uriInfo){
  final SingleResultQueryResult response=new SingleResultQueryResult();
  final List<JAXBElement> fields=createShellJAXBElementList(items,result);
  generateLinksInElementsList(context,fields);
  response.setFields(fields);
  response.addLink(new LinkV2(ReservedWords.JPARS_REL_SELF,uriInfo.getRequestUri().toString()));
  return response;
}
Program: 63359
Project: 63359
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildReportQueryResponse(PersistenceContext context,Map<String,Object> queryParams,List<Object[]> results,List<ReportItem> items,UriInfo uriInfo){
  ReportQueryResultCollection response=new ReportQueryResultCollection();
  for (  Object result : results) {
    ReportQueryResultListItem queryResultListItem=new ReportQueryResultListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(items,result);
    if (jaxbFields == null) {
      return null;
    }
    generateLinksInElementsList(context,jaxbFields);
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  response.addLink(new LinkV2(ReservedWords.JPARS_REL_SELF,uriInfo.getRequestUri().toString()));
  return response;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object buildReportQueryResponse(PersistenceContext context,Map<String,Object> queryParams,List<Object[]> results,List<ReportItem> items,UriInfo uriInfo){
  ReportQueryResultCollection response=new ReportQueryResultCollection();
  for (  Object result : results) {
    ReportQueryResultListItem queryResultListItem=new ReportQueryResultListItem();
    List<JAXBElement> jaxbFields=createShellJAXBElementList(items,result);
    generateLinksInElementsList(context,jaxbFields);
    queryResultListItem.setFields(jaxbFields);
    response.addItem(queryResultListItem);
  }
  response.addLink(new LinkV2(ReservedWords.JPARS_REL_SELF,uriInfo.getRequestUri().toString()));
  return response;
}
Program: 63363
Project: 63363
Buggy source:
@Override public int compareTo(SortableKey o){
  return mapping.getAttributeName().compareTo(o.getMapping().getAttributeName());
}

Fixed version (ground truth):
@Override public int compareTo(SortableKey o){
  if (this.equals(o)) {
    return 0;
  }
 else   if (mapping.getAttributeName().equals(o.getMapping().getAttributeName())) {
    return Integer.compare(index,o.getIndex());
  }
 else {
    return mapping.getAttributeName().compareTo(o.getMapping().getAttributeName());
  }
}
Program: 63364
Project: 63364
Buggy source:
/** 
 * Instantiates a new method exit log data.
 * @param result the result
 */
public MethodExitLogData(Object[] result){
  super();
  this.result=result;
}

Fixed version (ground truth):
/** 
 * Instantiates a new method exit log data.
 * @param result the result
 */
public MethodExitLogData(Object[] result){
  super();
  if (result != null) {
    this.result=Arrays.copyOf(result,result.length);
  }
}
Program: 63366
Project: 63366
Buggy source:
/** 
 * Instantiates a new pre login mapping adapter.
 * @param jpaSession the jpa session
 */
public PreLoginMappingAdapterV2(AbstractSession jpaSession){
  this.jpaSession=jpaSession;
}

Fixed version (ground truth):
/** 
 * Instantiates a new pre login mapping adapter.
 */
public PreLoginMappingAdapterV2(){
}
Program: 63368
Project: 63368
Buggy source:
private static Method[] getMethods(Class<?> cls){
  if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
    return AccessController.doPrivileged(new PrivilegedGetDeclaredMethods(cls));
  }
  return PrivilegedAccessHelper.getMethods(cls);
}

Fixed version (ground truth):
private static Method[] getMethods(Class<?> cls){
  if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
    return AccessController.doPrivileged(new PrivilegedGetMethods(cls));
  }
  return PrivilegedAccessHelper.getMethods(cls);
}
Program: 63369
Project: 63369
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildAttributeResponse(PersistenceContext context,Map<String,Object> queryParams,String attribute,Object results,UriInfo uriInfo){
  if (results instanceof List) {
    final List<Object> items=(List<Object>)results;
    if (containsDomainObjects(items)) {
      if (!items.isEmpty()) {
        ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
        response.setItems(items);
        return populatePagedCollectionLinks(queryParams,uriInfo,response);
      }
    }
  }
  return results;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object buildAttributeResponse(PersistenceContext context,Map<String,Object> queryParams,String attribute,Object results,UriInfo uriInfo){
  if (results instanceof List) {
    ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
    response.setItems((List<Object>)results);
    return populatePagedCollectionLinks(queryParams,uriInfo,response);
  }
  return results;
}
Program: 63372
Project: 63372
Buggy source:
@Test @Bugzilla(bugid=338783,databaseNames={"String_Node_Str","String_Node_Str"}) public void testDeleteAllDepartments() throws SQLException {
  EntityManager em=getEnvironment().getEntityManager();
  try {
    init();
    getEnvironment().beginTransaction(em);
    Query emplyoeeDelete=em.createQuery("String_Node_Str");
    emplyoeeDelete.executeUpdate();
    Query query=em.createQuery("String_Node_Str");
    int count=query.executeUpdate();
    if (!"String_Node_Str".equals(getEnvironment().getPropertyValue(em,PersistenceUnitProperties.BATCH_WRITING))) {
      verify(count == 2,"String_Node_Str" + count);
    }
    getEnvironment().commitTransaction(em);
    verifyCountOnDatabase(0,"String_Node_Str");
    init();
    getEnvironment().beginTransaction(em);
    emplyoeeDelete=em.createQuery("String_Node_Str");
    emplyoeeDelete.executeUpdate();
    query=em.createQuery("String_Node_Str");
    count=query.executeUpdate();
    if (!"String_Node_Str".equals(getEnvironment().getPropertyValue(em,PersistenceUnitProperties.BATCH_WRITING))) {
      verify(count == 1,"String_Node_Str" + count);
    }
    getEnvironment().commitTransaction(em);
    verifyCountOnDatabase(1,"String_Node_Str");
  }
  finally {
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
@Test public void testDeleteAllDepartments() throws SQLException {
  EntityManager em=getEnvironment().getEntityManager();
  try {
    init();
    getEnvironment().beginTransaction(em);
    Query emplyoeeDelete=em.createQuery("String_Node_Str");
    emplyoeeDelete.executeUpdate();
    Query query=em.createQuery("String_Node_Str");
    int count=query.executeUpdate();
    if (!"String_Node_Str".equals(getEnvironment().getPropertyValue(em,PersistenceUnitProperties.BATCH_WRITING))) {
      verify(count == 2,"String_Node_Str" + count);
    }
    getEnvironment().commitTransaction(em);
    verifyCountOnDatabase(0,"String_Node_Str");
    init();
    getEnvironment().beginTransaction(em);
    emplyoeeDelete=em.createQuery("String_Node_Str");
    emplyoeeDelete.executeUpdate();
    query=em.createQuery("String_Node_Str");
    count=query.executeUpdate();
    if (!"String_Node_Str".equals(getEnvironment().getPropertyValue(em,PersistenceUnitProperties.BATCH_WRITING))) {
      verify(count == 1,"String_Node_Str" + count);
    }
    getEnvironment().commitTransaction(em);
    verifyCountOnDatabase(1,"String_Node_Str");
  }
  finally {
    closeEntityManager(em);
  }
}
Program: 63373
Project: 63373
Buggy source:
@Test public void testExchange() throws SQLException {
  JPAEnvironment env=getEnvironment();
  EntityManager em=env.getEntityManager();
  try {
    final int newId;
    env.beginTransaction(em);
    Employee emp=em.find(Employee.class,HANS_ID);
    verify(emp != null,"String_Node_Str");
    Set<Project> projects=emp.getProjects();
    Iterator<Project> iter=projects.iterator();
    Project project=(Project)iter.next();
    int removedId=project.getId().intValue();
    em.remove(project);
    iter.remove();
    Project p7=new Project("String_Node_Str");
    em.persist(p7);
    newId=p7.getId().intValue();
    projects.add(p7);
    emp.clearPostUpdate();
    env.commitTransactionAndClear(em);
    verify(emp.postUpdateWasCalled(),"String_Node_Str");
    Set<Pair> expected=new HashSet<Pair>(SEED_SET);
    expected.remove(new Pair(HANS_ID_VALUE,removedId));
    expected.remove(new Pair(FRED_ID_VALUE,removedId));
    expected.add(new Pair(HANS_ID_VALUE,newId));
    checkJoinTable(expected);
    env.beginTransaction(em);
    emp=em.find(Employee.class,HANS_ID);
    projects=emp.getProjects();
    verify(projects.size() == 3,"String_Node_Str" + projects.size());
    env.rollbackTransactionAndClear(em);
  }
  finally {
    env.evictAll(em);
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
@Test public void testExchange() throws SQLException {
  JPAEnvironment env=getEnvironment();
  EntityManager em=env.getEntityManager();
  try {
    final int newId;
    env.beginTransaction(em);
    Employee emp=em.find(Employee.class,HANS_ID);
    verify(emp != null,"String_Node_Str");
    Set<Project> projects=emp.getProjects();
    Iterator<Project> iter=projects.iterator();
    Project project=iter.next();
    int removedId=project.getId().intValue();
    em.remove(project);
    iter.remove();
    Project p7=new Project("String_Node_Str");
    em.persist(p7);
    newId=p7.getId().intValue();
    projects.add(p7);
    emp.clearPostUpdate();
    env.commitTransactionAndClear(em);
    verify(emp.postUpdateWasCalled(),"String_Node_Str");
    Set<Pair> expected=new HashSet<Pair>(SEED_SET);
    expected.remove(new Pair(HANS_ID_VALUE,removedId));
    expected.remove(new Pair(FRED_ID_VALUE,removedId));
    expected.add(new Pair(HANS_ID_VALUE,newId));
    checkJoinTable(expected);
    env.beginTransaction(em);
    emp=em.find(Employee.class,HANS_ID);
    projects=emp.getProjects();
    verify(projects.size() == 3,"String_Node_Str" + projects.size());
    env.rollbackTransactionAndClear(em);
  }
  finally {
    env.evictAll(em);
    closeEntityManager(em);
  }
}
Program: 63374
Project: 63374
Buggy source:
@Test @Bugzilla(bugid=338783,databaseNames={"String_Node_Str","String_Node_Str"}) public void testCascadeMerge() throws IOException, ClassNotFoundException {
  JPAEnvironment env=getEnvironment();
  EntityManager em=env.getEntityManager();
  try {
    env.beginTransaction(em);
    em.createQuery("String_Node_Str").executeUpdate();
    em.createQuery("String_Node_Str").executeUpdate();
    env.commitTransactionAndClear(em);
    env.beginTransaction(em);
    Bicycle bicycle=new Bicycle();
    em.persist(bicycle);
    Short bikeId=bicycle.getId();
    env.commitTransaction(em);
    bicycle=em.find(Bicycle.class,bikeId);
    em.clear();
    bicycle=AbstractBaseTest.serializeDeserialize(bicycle);
    Employee emp=new Employee(9999,"String_Node_Str","String_Node_Str",null);
    emp.clearPostPersist();
    bicycle.setRiders(Collections.singleton(emp));
    env.beginTransaction(em);
    Bicycle mergedBike=em.merge(bicycle);
    env.commitTransactionAndClear(em);
    Employee mergedEmp=mergedBike.getRiders().iterator().next();
    verify(mergedEmp.postPersistWasCalled(),"String_Node_Str");
    verify(em.find(Employee.class,9999) != null,"String_Node_Str");
  }
  finally {
    closeEntityManager(em);
  }
}

Fixed version (ground truth):
@Test public void testCascadeMerge() throws IOException, ClassNotFoundException {
  JPAEnvironment env=getEnvironment();
  EntityManager em=env.getEntityManager();
  try {
    env.beginTransaction(em);
    em.createQuery("String_Node_Str").executeUpdate();
    em.createQuery("String_Node_Str").executeUpdate();
    env.commitTransactionAndClear(em);
    env.beginTransaction(em);
    Bicycle bicycle=new Bicycle();
    em.persist(bicycle);
    Short bikeId=bicycle.getId();
    env.commitTransaction(em);
    bicycle=em.find(Bicycle.class,bikeId);
    em.clear();
    bicycle=AbstractBaseTest.serializeDeserialize(bicycle);
    Employee emp=new Employee(9999,"String_Node_Str","String_Node_Str",null);
    emp.clearPostPersist();
    bicycle.setRiders(Collections.singleton(emp));
    env.beginTransaction(em);
    Bicycle mergedBike=em.merge(bicycle);
    env.commitTransactionAndClear(em);
    Employee mergedEmp=mergedBike.getRiders().iterator().next();
    verify(mergedEmp.postPersistWasCalled(),"String_Node_Str");
    verify(em.find(Employee.class,9999) != null,"String_Node_Str");
  }
  finally {
    closeEntityManager(em);
  }
}
Program: 63376
Project: 63376
Buggy source:
/** 
 * INTERNAL:
 */
public Map<String,ATTRIBUTE_ITEM> getItems(){
  if (this.items == null) {
    this.items=new HashMap();
  }
  return this.items;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @return Non-null Map of attributes in the group mapped to their AttributeItems
 */
public Map<String,ATTRIBUTE_ITEM> getItems(){
  if (this.items == null) {
    this.items=new HashMap();
  }
  return this.items;
}
Program: 63377
Project: 63377
Buggy source:
@Override public int hashCode(){
  Map<String,ATTRIBUTE_ITEM> items=getItems();
  int result=superClassGroup != null ? superClassGroup.hashCode() : 0;
  result=31 * result + (items != null ? items.hashCode() : 0);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=superClassGroup != null ? superClassGroup.hashCode() : 0;
  result=31 * result + getItems().hashCode();
  return result;
}
Program: 63378
Project: 63378
Buggy source:
@Override public int hashCode(){
  Object[] typePropertyValues=getTypePropertyValues();
  boolean[] typePropertiesIsSetStatus=getTypePropertiesIsSetStatus();
  Map openContentValues=getOpenContentValues();
  int result=dataObject != null ? dataObject.hashCode() : 0;
  result=31 * result + (typePropertyValues != null ? Arrays.hashCode(typePropertyValues) : 0);
  result=31 * result + (typePropertiesIsSetStatus != null ? Arrays.hashCode(typePropertiesIsSetStatus) : 0);
  result=31 * result + (openContentValues != null ? openContentValues.hashCode() : 0);
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  Object[] typePropertyValues=getTypePropertyValues();
  boolean[] typePropertiesIsSetStatus=getTypePropertiesIsSetStatus();
  int result=dataObject != null ? dataObject.hashCode() : 0;
  result=31 * result + (typePropertyValues != null ? Arrays.hashCode(typePropertyValues) : 0);
  result=31 * result + (typePropertiesIsSetStatus != null ? Arrays.hashCode(typePropertiesIsSetStatus) : 0);
  result=31 * result + getOpenContentValues().hashCode();
  return result;
}
Program: 63379
Project: 63379
Buggy source:
/** 
 * INTERNAL:
 * @return Map of values for open content properties
 */
public Map getOpenContentValues(){
  if (openContentValues == null) {
    openContentValues=new HashMap();
  }
  return openContentValues;
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @return Non-null Map of values for open content properties
 */
public Map getOpenContentValues(){
  if (openContentValues == null) {
    openContentValues=new HashMap();
  }
  return openContentValues;
}
Program: 63380
Project: 63380
Buggy source:
public void addTests(){
  addSRGTests();
  addTest(new QueryTimeoutTest());
  addTest(new ServerSessionTestAdapter(new PessimisticLockNoLockJoinedTest()));
  addTest(new ReadAllNoDistinctTest());
  addTest(new PartialAttributeTestWithJoinAttribute());
  addTest(new PartialAttributeDistinctOrderByTest());
  addTest(new FourPartialAttributeTestsWithJoinAttribute());
  addTest(buildReadOnlyQueryTest());
  addTest(buildGetSQLTest());
  addTest(buildJoinSubclassesQueryTest());
  addTest(buildRecordTest());
  addTest(new ConformResultsWithMultitableAndJoiningTest());
  addTest(new CachedUpdateCallsQueryClearTest());
  addTest(new ZeroPrimaryKeyExistenceCheckTest(true));
  addTest(new ZeroPrimaryKeyExistenceCheckTest(false));
  addTest(new QueryTimeoutConnectionReleasedTest());
  addTest(new QueryExecutionTimeSetOnBuildObjectTest());
  addTest(new PartialAttributeWithCustomSQLTest());
  addTest(buildArgumentValuesTest());
  addTest(new ScrollableCursorForwardOnlyResultSetTest());
  addTest(new ConformResultsSubclassesTest());
  addTest(new ScrollableCursorJoinedAttributeTest());
  addTest(new ScrollableCursorJoiningVerificationTest());
  addTest(new MultipleOrderByWithSameFieldNameNullsFirstTest());
  addTest(new MultipleOrderByWithSameFieldNameTest());
  addTest(buildUnionTest());
}

Fixed version (ground truth):
public void addTests(){
  addSRGTests();
  addTest(new QueryTimeoutTest());
  addTest(new ServerSessionTestAdapter(new PessimisticLockNoLockJoinedTest()));
  addTest(new ReadAllNoDistinctTest());
  addTest(new ObjectLevelReadQueryTest.CustomQueryRaceConditionsInReadAllQueryTest());
  addTest(new ObjectLevelReadQueryTest.CustomQueryRaceConditionsInReadObjectQueryTest());
  addTest(new PartialAttributeTestWithJoinAttribute());
  addTest(new PartialAttributeDistinctOrderByTest());
  addTest(new FourPartialAttributeTestsWithJoinAttribute());
  addTest(buildReadOnlyQueryTest());
  addTest(buildGetSQLTest());
  addTest(buildJoinSubclassesQueryTest());
  addTest(buildRecordTest());
  addTest(new ConformResultsWithMultitableAndJoiningTest());
  addTest(new CachedUpdateCallsQueryClearTest());
  addTest(new ZeroPrimaryKeyExistenceCheckTest(true));
  addTest(new ZeroPrimaryKeyExistenceCheckTest(false));
  addTest(new QueryTimeoutConnectionReleasedTest());
  addTest(new QueryExecutionTimeSetOnBuildObjectTest());
  addTest(new PartialAttributeWithCustomSQLTest());
  addTest(buildArgumentValuesTest());
  addTest(new ScrollableCursorForwardOnlyResultSetTest());
  addTest(new ConformResultsSubclassesTest());
  addTest(new ScrollableCursorJoinedAttributeTest());
  addTest(new ScrollableCursorJoiningVerificationTest());
  addTest(new MultipleOrderByWithSameFieldNameNullsFirstTest());
  addTest(new MultipleOrderByWithSameFieldNameTest());
  addTest(buildUnionTest());
}
Program: 63381
Project: 63381
Buggy source:
/** 
 * INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.
 */
protected void setIsCustomQueryUsed(boolean isCustomQueryUsed){
  if (isCustomQueryUsed) {
    this.isCustomQueryUsed=Boolean.TRUE;
  }
 else {
    this.isCustomQueryUsed=Boolean.FALSE;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.
 * @param isCustomQueryUsed Custom query flag as {@code boolean}.
 */
protected void setIsCustomQueryUsed(final boolean isCustomQueryUsed){
  this.isCustomQueryUsed=isCustomQueryUsed;
}
Program: 63384
Project: 63384
Buggy source:
public Object buildAttributeValue(Record record,Object object,Session session){
  if (null == record) {
    return null;
  }
  String value=(String)record.get(xPath);
  if (null == value) {
    return null;
  }
  QName qName=null;
  int index=value.lastIndexOf(COLON);
  if (index > -1) {
    String prefix=value.substring(0,index);
    String localName=value.substring(index + 1);
    String namespaceURI=((XMLRecord)record).resolveNamespacePrefix(prefix);
    if (W3C_XML_SCHEMA_NS_URI.equals(namespaceURI)) {
      qName=SCHEMA_QNAMES.get(localName);
      if (qName == null) {
        qName=new QName(W3C_XML_SCHEMA_NS_URI,localName,prefix == null ? DEFAULT_NS_PREFIX : prefix);
      }
    }
 else {
      qName=new QName(namespaceURI == null ? NULL_NS_URI : namespaceURI,localName,prefix == null ? DEFAULT_NS_PREFIX : prefix);
    }
    return qName;
  }
 else {
    String namespaceURI=((XMLRecord)record).resolveNamespacePrefix(DEFAULT_NAMESPACE_PREFIX);
    qName=new QName(namespaceURI,value);
  }
  return qName;
}

Fixed version (ground truth):
@Override public Object buildAttributeValue(Record record,Object object,Session session){
  if (null == record) {
    return null;
  }
  String value=(String)record.get(xPath);
  if (null == value) {
    return null;
  }
  QName qName=null;
  int index=value.lastIndexOf(COLON);
  if (index > -1) {
    String prefix=value.substring(0,index);
    String localName=value.substring(index + 1);
    String namespaceURI=((XMLRecord)record).resolveNamespacePrefix(prefix);
    if (W3C_XML_SCHEMA_NS_URI.equals(namespaceURI)) {
      qName=SCHEMA_QNAMES.get(localName);
      if (qName == null) {
        qName=new QName(W3C_XML_SCHEMA_NS_URI,localName,prefix == null ? DEFAULT_NS_PREFIX : prefix);
      }
    }
 else {
      qName=new QName(namespaceURI == null ? NULL_NS_URI : namespaceURI,localName,prefix == null ? DEFAULT_NS_PREFIX : prefix);
    }
    return qName;
  }
 else {
    String namespaceURI=((XMLRecord)record).resolveNamespacePrefix(DEFAULT_NAMESPACE_PREFIX);
    qName=new QName(namespaceURI,value);
  }
  return qName;
}
Program: 63385
Project: 63385
Buggy source:
public Object buildFieldValue(Object instance,String fieldName,Session session){
  if (null == instance) {
    return null;
  }
  QName qName=(QName)transformationMapping.getAttributeValueFromObject(instance);
  if (null == qName.getNamespaceURI()) {
    return qName.getLocalPart();
  }
 else {
    String namespaceURI=qName.getNamespaceURI();
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      return qName.getLocalPart();
    }
 else {
      return prefix + COLON + qName.getLocalPart();
    }
  }
}

Fixed version (ground truth):
@Override public Object buildFieldValue(Object instance,String fieldName,Session session){
  if (null == instance) {
    return null;
  }
  QName qName=(QName)transformationMapping.getAttributeValueFromObject(instance);
  if (null == qName.getNamespaceURI()) {
    return qName.getLocalPart();
  }
 else {
    String namespaceURI=qName.getNamespaceURI();
    String prefix=namespaceResolver.resolveNamespaceURI(namespaceURI);
    if (null == prefix) {
      return qName.getLocalPart();
    }
 else {
      return prefix + COLON + qName.getLocalPart();
    }
  }
}
Program: 63386
Project: 63386
Buggy source:
public void initialize(AbstractTransformationMapping mapping){
  transformationMapping=mapping;
  namespaceResolver=((XMLDescriptor)mapping.getDescriptor()).getNamespaceResolver();
}

Fixed version (ground truth):
@Override public void initialize(AbstractTransformationMapping mapping){
  transformationMapping=mapping;
  namespaceResolver=((XMLDescriptor)mapping.getDescriptor()).getNamespaceResolver();
}
Program: 63388
Project: 63388
Buggy source:
public int hashCode(){
  return ((key == null) ? 0 : key.hashCode()) ^ ((value == null) ? 0 : value.hashCode());
}

Fixed version (ground truth):
@Override public int hashCode(){
  List<Object> results=getResults();
  Object id=getId();
  int result=results != null ? results.hashCode() : 0;
  result=31 * result + (id != null ? id.hashCode() : 0);
  return result;
}
Program: 63390
Project: 63390
Buggy source:
public void testNewContextGeneratedWithResolverReturned(){
  final SDOHelperContext foo=new SDOHelperContext("String_Node_Str");
  SDOHelperContext.setHelperContextResolver(new SDOHelperContext.HelperContextResolver(){
    @Override public HelperContext getHelperContext(    String id,    ClassLoader classLoader){
      return foo;
    }
  }
);
  SDOHelperContext hc=(SDOHelperContext)SDOHelperContext.getHelperContext("String_Node_Str");
  assertEquals("String_Node_Str",hc,foo);
  SDOHelperContext.setHelperContextResolver(null);
  hc=(SDOHelperContext)SDOHelperContext.getHelperContext("String_Node_Str");
  assertFalse("String_Node_Str",foo.equals(hc));
}

Fixed version (ground truth):
public void testNewContextGeneratedWithResolverReturned(){
  final SDOHelperContext foo=new SDOHelperContext("String_Node_Str");
  SDOHelperContext.setHelperContextResolver((id,classLoader) -> foo);
  SDOHelperContext hc=(SDOHelperContext)SDOHelperContext.getHelperContext("String_Node_Str");
  assertEquals("String_Node_Str",hc,foo);
  SDOHelperContext.setHelperContextResolver(null);
  hc=(SDOHelperContext)SDOHelperContext.getHelperContext("String_Node_Str");
  assertFalse("String_Node_Str",foo.equals(hc));
}
Program: 63391
Project: 63391
Buggy source:
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new SDOXSDHelperTestSuite().suite());
  suite.addTest(new SDOTypeHelperTestSuite().suite());
  suite.addTest(new SDODataFactoryTestSuite().suite());
  suite.addTest(new SDOXMLHelperTestSuite().suite());
  suite.addTestSuite(SDOHelperTestCases.class);
  return suite;
}

Fixed version (ground truth):
/** 
 * Inherited suite method for generating all test cases.
 * @return
 */
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new SDOXSDHelperTestSuite().suite());
  suite.addTest(new SDOTypeHelperTestSuite().suite());
  suite.addTest(new SDODataFactoryTestSuite().suite());
  suite.addTest(new SDOXMLHelperTestSuite().suite());
  suite.addTestSuite(SDOHelperTestCases.class);
  suite.addTestSuite(SDOHelperContextTest.class);
  return suite;
}
Program: 63392
Project: 63392
Buggy source:
/** 
 * Return the local helper context with the given identifier, or create one if it does not already exist.
 */
public static HelperContext getHelperContext(String identifier,ClassLoader classLoader){
  ConcurrentMap<String,String> aliasEntries=getAliasMap();
  if (aliasEntries.containsKey(identifier)) {
    identifier=aliasEntries.get(identifier);
  }
  HelperContext helperContext=getUserSetHelperContext(identifier,classLoader);
  if (helperContext != null) {
    return helperContext;
  }
  ConcurrentMap<String,HelperContext> contextMap=getContextMap();
  helperContext=contextMap.get(identifier);
  if (null == helperContext) {
    helperContext=new SDOHelperContext(identifier,classLoader);
    HelperContext existingContext=contextMap.putIfAbsent(identifier,helperContext);
    if (existingContext != null) {
      helperContext=existingContext;
    }
  }
  return helperContext;
}

Fixed version (ground truth):
@Override public HelperContext getHelperContext(String id,ClassLoader classLoader){
  LOGGER.fine(String.format("String_Node_Str",id,classLoader));
  return new SDOHelperContext(id,classLoader);
}
Program: 63393
Project: 63393
Buggy source:
public void addTests(){
  addSRGTests();
  addTest(new QueryTimeoutTest());
  addTest(new ServerSessionTestAdapter(new PessimisticLockNoLockJoinedTest()));
  addTest(new ReadAllNoDistinctTest());
  addTest(ObjectLevelReadQueryTest.suite());
  addTest(new PartialAttributeTestWithJoinAttribute());
  addTest(new PartialAttributeDistinctOrderByTest());
  addTest(new FourPartialAttributeTestsWithJoinAttribute());
  addTest(buildReadOnlyQueryTest());
  addTest(buildGetSQLTest());
  addTest(buildJoinSubclassesQueryTest());
  addTest(buildRecordTest());
  addTest(new ConformResultsWithMultitableAndJoiningTest());
  addTest(new CachedUpdateCallsQueryClearTest());
  addTest(new ZeroPrimaryKeyExistenceCheckTest(true));
  addTest(new ZeroPrimaryKeyExistenceCheckTest(false));
  addTest(new QueryTimeoutConnectionReleasedTest());
  addTest(new QueryExecutionTimeSetOnBuildObjectTest());
  addTest(new PartialAttributeWithCustomSQLTest());
  addTest(buildArgumentValuesTest());
  addTest(new ScrollableCursorForwardOnlyResultSetTest());
  addTest(new ConformResultsSubclassesTest());
  addTest(new ScrollableCursorJoinedAttributeTest());
  addTest(new ScrollableCursorJoiningVerificationTest());
  addTest(new MultipleOrderByWithSameFieldNameNullsFirstTest());
  addTest(new MultipleOrderByWithSameFieldNameTest());
  addTest(buildUnionTest());
}

Fixed version (ground truth):
public void addTests(){
  addSRGTests();
  addTest(new QueryTimeoutTest());
  addTest(new ServerSessionTestAdapter(new PessimisticLockNoLockJoinedTest()));
  addTest(new ReadAllNoDistinctTest());
  addTest(new PartialAttributeTestWithJoinAttribute());
  addTest(new PartialAttributeDistinctOrderByTest());
  addTest(new FourPartialAttributeTestsWithJoinAttribute());
  addTest(buildReadOnlyQueryTest());
  addTest(buildGetSQLTest());
  addTest(buildJoinSubclassesQueryTest());
  addTest(buildRecordTest());
  addTest(new ConformResultsWithMultitableAndJoiningTest());
  addTest(new CachedUpdateCallsQueryClearTest());
  addTest(new ZeroPrimaryKeyExistenceCheckTest(true));
  addTest(new ZeroPrimaryKeyExistenceCheckTest(false));
  addTest(new QueryTimeoutConnectionReleasedTest());
  addTest(new QueryExecutionTimeSetOnBuildObjectTest());
  addTest(new PartialAttributeWithCustomSQLTest());
  addTest(buildArgumentValuesTest());
  addTest(new ScrollableCursorForwardOnlyResultSetTest());
  addTest(new ConformResultsSubclassesTest());
  addTest(new ScrollableCursorJoinedAttributeTest());
  addTest(new ScrollableCursorJoiningVerificationTest());
  addTest(new MultipleOrderByWithSameFieldNameNullsFirstTest());
  addTest(new MultipleOrderByWithSameFieldNameTest());
  addTest(buildUnionTest());
}
Program: 63394
Project: 63394
Buggy source:
/** 
 * INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.
 * @param isCustomQueryUsed Custom query flag as {@code boolean}.
 */
protected void setIsCustomQueryUsed(final boolean isCustomQueryUsed){
  this.isCustomQueryUsed=isCustomQueryUsed;
}

Fixed version (ground truth):
/** 
 * INTERNAL: PERF: Set if this query will use the descriptor custom query instead of executing itself.
 */
protected void setIsCustomQueryUsed(boolean isCustomQueryUsed){
  if (isCustomQueryUsed) {
    this.isCustomQueryUsed=Boolean.TRUE;
  }
 else {
    this.isCustomQueryUsed=Boolean.FALSE;
  }
}