nus-yam/ex-repair huggingface dataset:
Program: 63397
Project: 63397
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(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());
}
Program: 63398
Project: 63398
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: 63401
Project: 63401
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.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=(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: 63402
Project: 63402
Buggy source:
public DataHandler getAttachmentAsDataHandler(String id){
  String attachmentRefId=id;
  if (attachmentRefId.startsWith("String_Node_Str")) {
    attachmentRefId=attachmentRefId.substring(4);
  }
  return attachments.get(attachmentRefId);
}

Fixed version (ground truth):
@Override public DataHandler getAttachmentAsDataHandler(String id){
  String attachmentRefId=id;
  if (attachmentRefId.startsWith("String_Node_Str")) {
    attachmentRefId=attachmentRefId.substring(4);
  }
  return attachments.get(attachmentRefId);
}
Program: 63403
Project: 63403
Buggy source:
public boolean isXOPPackage(){
  return true;
}

Fixed version (ground truth):
@Override public boolean isXOPPackage(){
  return true;
}
Program: 63405
Project: 63405
Buggy source:
public byte[] getAttachmentAsByteArray(String id){
  ByteArrayOutputStream out=null;
  try {
    DataHandler dh=attachments.get(id);
    if (dh == null) {
      return null;
    }
    InputStream in=dh.getInputStream();
    out=new ByteArrayOutputStream(1024);
    byte[] buf=new byte[1024];
    int len;
    while ((len=in.read(buf)) > 0) {
      out.write(buf,0,len);
    }
  }
 catch (  IOException e) {
  }
  if (out != null) {
    return out.toByteArray();
  }
  return null;
}

Fixed version (ground truth):
@Override public byte[] getAttachmentAsByteArray(String id){
  ByteArrayOutputStream out=null;
  try {
    DataHandler dh=attachments.get(id);
    if (dh == null) {
      return null;
    }
    InputStream in=dh.getInputStream();
    out=new ByteArrayOutputStream(1024);
    byte[] buf=new byte[1024];
    int len;
    while ((len=in.read(buf)) > 0) {
      out.write(buf,0,len);
    }
  }
 catch (  IOException e) {
  }
  if (out != null) {
    return out.toByteArray();
  }
  return null;
}
Program: 63407
Project: 63407
Buggy source:
public void initializeCall(XRServiceAdapter xrService,QueryOperation queryOperation,DatabaseQuery databaseQuery){
}

Fixed version (ground truth):
@Override public void initializeCall(XRServiceAdapter xrService,QueryOperation queryOperation,DatabaseQuery databaseQuery){
}
Program: 63409
Project: 63409
Buggy source:
public void initializeArguments(XRServiceAdapter xrService,QueryOperation queryOperation,DatabaseQuery databaseQuery){
}

Fixed version (ground truth):
@Override public void initializeArguments(XRServiceAdapter xrService,QueryOperation queryOperation,DatabaseQuery databaseQuery){
}
Program: 63410
Project: 63410
Buggy source:
@Override public Object getAttributeValueFromObject(Object object) throws DescriptorException {
  Object result=null;
  InputStream is=null;
  DataHandler dataHandler=(DataHandler)object;
  try {
    result=dataHandler.getContent();
    if (result instanceof InputStream) {
      is=(InputStream)result;
      byte[] buf=new byte[2048];
      ByteArrayOutputStream baos=new ByteArrayOutputStream();
      int bytesRead=is.read(buf);
      while (bytesRead >= 0) {
        baos.write(buf,0,bytesRead);
        bytesRead=is.read(buf);
      }
      result=baos.toByteArray();
    }
  }
 catch (  IOException e) {
  }
 finally {
    try {
      is.close();
    }
 catch (    IOException e) {
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public Object getAttributeValueFromObject(Object object) throws DescriptorException {
  Object result=null;
  DataHandler dataHandler=(DataHandler)object;
  try {
    result=dataHandler.getContent();
    if (result instanceof InputStream) {
      try (InputStream is=(InputStream)result){
        byte[] buf=new byte[2048];
        ByteArrayOutputStream baos=new ByteArrayOutputStream();
        int bytesRead=is.read(buf);
        while (bytesRead >= 0) {
          baos.write(buf,0,bytesRead);
          bytesRead=is.read(buf);
        }
        result=baos.toByteArray();
      }
     }
  }
 catch (  IOException e) {
  }
  return result;
}
Program: 63412
Project: 63412
Buggy source:
public void initializeDatabaseQuery(XRServiceAdapter xrService,QueryOperation queryOperation){
}

Fixed version (ground truth):
@Override public void initializeDatabaseQuery(XRServiceAdapter xrService,QueryOperation queryOperation){
}
Program: 63417
Project: 63417
Buggy source:
public void endUnmappedElement(String namespaceURI,String localName,String qName) throws SAXException {
  typeQName=null;
  levelIndex--;
  if ((0 == levelIndex) && (null != parentRecord) && !isSelfRecord()) {
    endDocument();
    UnmarshalRecord pRec=parentRecord;
    while (pRec.isSelfRecord()) {
      pRec=pRec.getParentRecord();
    }
    pRec.endElement(namespaceURI,localName,qName);
    xmlReader.setContentHandler(pRec);
    xmlReader.setLexicalHandler(pRec);
  }
}

Fixed version (ground truth):
public void endUnmappedElement(String namespaceURI,String localName,String qName) throws SAXException {
  typeQName=null;
  levelIndex--;
  if ((0 == levelIndex) && (null != parentRecord) && !isSelfRecord()) {
    endDocument();
    UnmarshalRecord pRec=parentRecord;
    while (pRec.isSelfRecord()) {
      pRec=pRec.getParentRecord();
    }
    pRec.endElement(namespaceURI,localName,qName);
    xmlReader.setContentHandler(pRec);
    xmlReader.setLexicalHandler(pRec);
  }
  setNil(false);
}
Program: 63418
Project: 63418
Buggy source:
FlushModeProp(){
  super(EntityManagerProperties.PERSISTENCE_CONTEXT_FLUSH_MODE,FlushModeType.AUTO.toString());
  valueArray=new Object[]{FlushModeType.AUTO.toString(),FlushModeType.COMMIT.toString()};
}

Fixed version (ground truth):
FlushModeProp(){
  super(EntityManagerProperties.PERSISTENCE_CONTEXT_FLUSH_MODE,"String_Node_Str");
  valueArray=new Object[]{"String_Node_Str","String_Node_Str"};
}
Program: 63419
Project: 63419
Buggy source:
public SDOXMLHelperDelegate(HelperContext aContext,ClassLoader aClassLoader){
  aHelperContext=aContext;
  loader=new SDOClassLoader(aClassLoader,aContext);
  xmlMarshallerMap=new WeakHashMap<Thread,XMLMarshaller>();
  xmlUnmarshallerMap=new WeakHashMap<Thread,XMLUnmarshaller>();
}

Fixed version (ground truth):
public SDOXMLHelperDelegate(HelperContext aContext,ClassLoader aClassLoader){
  aHelperContext=aContext;
  loader=new SDOClassLoader(aClassLoader,aContext);
  xmlMarshallerMap=Collections.synchronizedMap(new WeakHashMap<Thread,XMLMarshaller>());
  xmlUnmarshallerMap=Collections.synchronizedMap(new WeakHashMap<Thread,XMLUnmarshaller>());
}
Program: 63420
Project: 63420
Buggy source:
/** 
 * Add the StructConverters that were specified by annotation on the DatabasePlatform This method must be called after the DatabasePlatform has been detected
 * @param session
 * @param structConverters
 */
public void addStructConverters(){
  if (this.compositeMemberEmSetupImpls == null) {
    for (    StructConverter structConverter : structConverters) {
      if (session.getPlatform().getTypeConverters().get(structConverter.getJavaType()) != null) {
        throw ValidationException.twoStructConvertersAddedForSameClass(structConverter.getJavaType().getName());
      }
      session.getPlatform().addStructConverter(structConverter);
    }
  }
 else {
    for (    EntityManagerSetupImpl compositeMemberEmSetupImpl : this.compositeMemberEmSetupImpls) {
      if (!compositeMemberEmSetupImpl.structConverters.isEmpty()) {
        String compositeMemberPuName=compositeMemberEmSetupImpl.getPersistenceUnitInfo().getPersistenceUnitName();
        compositeMemberEmSetupImpl.session.log(SessionLog.FINEST,SessionLog.PROPERTIES,"String_Node_Str",new Object[]{"String_Node_Str",compositeMemberPuName,state});
        compositeMemberEmSetupImpl.addStructConverters();
        compositeMemberEmSetupImpl.session.log(SessionLog.FINEST,SessionLog.PROPERTIES,"String_Node_Str",new Object[]{"String_Node_Str",compositeMemberPuName,state});
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add the StructConverters that were specified by annotation on the DatabasePlatform This method must be called after the DatabasePlatform has been detected
 */
public void addStructConverters(){
  if (this.compositeMemberEmSetupImpls == null) {
    for (    StructConverter structConverter : structConverters) {
      if (session.getPlatform().getTypeConverters().get(structConverter.getJavaType()) != null) {
        throw ValidationException.twoStructConvertersAddedForSameClass(structConverter.getJavaType().getName());
      }
      session.getPlatform().addStructConverter(structConverter);
    }
  }
 else {
    for (    EntityManagerSetupImpl compositeMemberEmSetupImpl : this.compositeMemberEmSetupImpls) {
      if (!compositeMemberEmSetupImpl.structConverters.isEmpty()) {
        String compositeMemberPuName=compositeMemberEmSetupImpl.getPersistenceUnitInfo().getPersistenceUnitName();
        compositeMemberEmSetupImpl.session.log(SessionLog.FINEST,SessionLog.PROPERTIES,"String_Node_Str",new Object[]{"String_Node_Str",compositeMemberPuName,state});
        compositeMemberEmSetupImpl.addStructConverters();
        compositeMemberEmSetupImpl.session.log(SessionLog.FINEST,SessionLog.PROPERTIES,"String_Node_Str",new Object[]{"String_Node_Str",compositeMemberPuName,state});
      }
    }
  }
}
Program: 63422
Project: 63422
Buggy source:
/** 
 * Normally when a property is missing nothing should be applied to the session. However there are several session attributes that defaulted in EJB3 to the values different from EclipseLink defaults. This function applies defaults for such properties and registers the session. All other session-related properties are applied in updateServerSession. Note that updateSession may be called several times on the same session (before login), but initSession is called just once - before the first call to updateSession.
 * @param properties the persistence unit properties.
 */
protected void initSession(){
  assignCMP3Policy();
  if (!isCompositeMember()) {
    addSessionToGlobalSessionManager();
  }
}

Fixed version (ground truth):
/** 
 * Normally when a property is missing nothing should be applied to the session. However there are several session attributes that defaulted in EJB3 to the values different from EclipseLink defaults. This function applies defaults for such properties and registers the session. All other session-related properties are applied in updateServerSession. Note that updateSession may be called several times on the same session (before login), but initSession is called just once - before the first call to updateSession.
 */
protected void initSession(){
  assignCMP3Policy();
  if (!isCompositeMember()) {
    addSessionToGlobalSessionManager();
  }
}
Program: 63423
Project: 63423
Buggy source:
/** 
 * As of EclipseLink 2.6.0 this returns Java SE 7- compatible provider by default on Java SE 7 and Java SE 8+ compatible provider if Java SE 8+ is detected.
 * @return default provider responsible for creating Java SE specific implementationsof  {@link IndirectCollection}s
 */
private static IndirectCollectionsProvider getProvider(){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      final Class support=(Class)AccessController.doPrivileged(new PrivilegedClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader()));
      return AccessController.doPrivileged(new PrivilegedAction<IndirectCollectionsProvider>(){
        @Override public IndirectCollectionsProvider run(){
          try {
            return (IndirectCollectionsProvider)support.newInstance();
          }
 catch (          InstantiationException|IllegalAccessException ex) {
            throw new RuntimeException(ex);
          }
        }
      }
);
    }
 else {
      Class support=PrivilegedAccessHelper.getClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader());
      return (IndirectCollectionsProvider)PrivilegedAccessHelper.newInstanceFromClass(support);
    }
  }
 catch (  Throwable t) {
    AbstractSessionLog.getLog().logThrowable(SessionLog.FINEST,SessionLog.MISC,t);
  }
  return new DefaultProvider();
}

Fixed version (ground truth):
/** 
 * As of EclipseLink 2.6.0 this returns Java SE 7- compatible provider by default on Java SE 7 and Java SE 8+ compatible provider if Java SE 8+ is detected.
 * @return default provider responsible for creating Java SE specific implementationsof  {@link IndirectCollection}s
 */
private static IndirectCollectionsProvider getProvider(){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      final Class support=(Class)AccessController.doPrivileged(new PrivilegedClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader()));
      return AccessController.doPrivileged(new PrivilegedAction<IndirectCollectionsProvider>(){
        @Override public IndirectCollectionsProvider run(){
          try {
            return (IndirectCollectionsProvider)support.newInstance();
          }
 catch (          InstantiationException|IllegalAccessException ex) {
            throw new RuntimeException(ex);
          }
        }
      }
);
    }
 else {
      Class support=PrivilegedAccessHelper.getClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader());
      return (IndirectCollectionsProvider)PrivilegedAccessHelper.newInstanceFromClass(support);
    }
  }
 catch (  Throwable t) {
    AbstractSessionLog.getLog().finest("String_Node_Str");
  }
  return new DefaultProvider();
}
Program: 63424
Project: 63424
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildAttributeResponse(PersistenceContext context,Map<String,Object> queryParams,String attribute,Object results,UriInfo uriInfo){
  if (results instanceof Collection) {
    if (containsDomainObjects(results)) {
      List<Object> items=(Vector)results;
      if ((items != null) && (!items.isEmpty())) {
        ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
        response.setItems(items);
        response.setCount(items.size());
        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 Collection) {
    if (containsDomainObjects(results)) {
      final List<Object> items=(Vector)results;
      if ((items != null) && (!items.isEmpty())) {
        ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
        response.setItems(items);
        return populatePagedCollectionLinks(queryParams,uriInfo,response);
      }
    }
  }
  return results;
}
Program: 63426
Project: 63426
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object buildReadAllQueryResponse(PersistenceContext context,Map<String,Object> queryParams,List<Object> items,UriInfo uriInfo){
  ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
  for (  Object item : items) {
    response.addItem(populatePagedReadAllQueryItemLinks(context,item));
  }
  response.setCount(items.size());
  return populatePagedCollectionLinks(queryParams,uriInfo,response);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object buildReadAllQueryResponse(PersistenceContext context,Map<String,Object> queryParams,List<Object> items,UriInfo uriInfo){
  ReadAllQueryResultCollection response=new ReadAllQueryResultCollection();
  for (  Object item : items) {
    response.addItem(populatePagedReadAllQueryItemLinks(context,item));
  }
  return populatePagedCollectionLinks(queryParams,uriInfo,response);
}
Program: 63428
Project: 63428
Buggy source:
private Response processPageableQuery(PersistenceContext context,String queryName,DatabaseQuery dbQuery,Query query,HttpHeaders headers,UriInfo uriInfo){
  final PageableQueryValidator validator=new PageableQueryValidator(context,queryName,uriInfo);
  if (validator.isFeatureApplicable()) {
    query.setFirstResult(validator.getOffset());
    query.setMaxResults(validator.getLimit());
    return namedQueryResponse(context,queryName,dbQuery,query,headers,uriInfo,new PagingResponseBuilder());
  }
 else {
    return namedQueryResponse(context,queryName,dbQuery,query,headers,uriInfo,new SelfLinksResponseBuilder());
  }
}

Fixed version (ground truth):
private Response processPageableQuery(PersistenceContext context,String queryName,DatabaseQuery dbQuery,Query query,HttpHeaders headers,UriInfo uriInfo){
  final PageableQueryValidator validator=new PageableQueryValidator(context,queryName,uriInfo);
  if (validator.isFeatureApplicable()) {
    query.setFirstResult(validator.getOffset());
    query.setMaxResults(validator.getLimit() + 1);
    return namedQueryResponse(context,queryName,dbQuery,query,headers,uriInfo,new PagingResponseBuilder());
  }
 else {
    return namedQueryResponse(context,queryName,dbQuery,query,headers,uriInfo,new SelfLinksResponseBuilder());
  }
}
Program: 63430
Project: 63430
Buggy source:
@Test public void testPageableFieldOffset() throws URISyntaxException {
  final Map<String,String> hints=new HashMap<>(1);
  hints.put("String_Node_Str","String_Node_Str");
  final String queryResult=RestUtils.restFindAttribute(context,1,Basket.class.getSimpleName(),"String_Node_Str",null,hints,MediaType.APPLICATION_XML_TYPE);
  logger.info(queryResult);
  assertFalse(queryResult.contains("String_Node_Str"));
  assertFalse(queryResult.contains("String_Node_Str"));
  assertTrue(queryResult.contains("String_Node_Str"));
  assertTrue(queryResult.contains("String_Node_Str"));
  assertFalse(queryResult.contains("String_Node_Str"));
  assertTrue(checkLinkXml(queryResult,"String_Node_Str","String_Node_Str") || checkLinkXml(queryResult,"String_Node_Str","String_Node_Str"));
  assertFalse(queryResult.contains("String_Node_Str"));
  checkItemsXml(queryResult,2,2,2,true);
}

Fixed version (ground truth):
@Test public void testPageableFieldOffset() throws URISyntaxException {
  final Map<String,String> hints=new HashMap<>(1);
  hints.put("String_Node_Str","String_Node_Str");
  final String queryResult=RestUtils.restFindAttribute(context,1,Basket.class.getSimpleName(),"String_Node_Str",null,hints,MediaType.APPLICATION_XML_TYPE);
  logger.info(queryResult);
  assertFalse(queryResult.contains("String_Node_Str"));
  assertFalse(queryResult.contains("String_Node_Str"));
  assertTrue(queryResult.contains("String_Node_Str"));
  assertTrue(queryResult.contains("String_Node_Str"));
  assertFalse(queryResult.contains("String_Node_Str"));
  assertTrue(checkLinkXml(queryResult,"String_Node_Str","String_Node_Str"));
  assertTrue(checkLinkXml(queryResult,"String_Node_Str","String_Node_Str"));
  checkItemsXml(queryResult,2,2,2,true);
}
Program: 63431
Project: 63431
Buggy source:
public TableDefinition buildCMP3_HINGETable(){
  TableDefinition table=new TableDefinition();
  table.setName("String_Node_Str");
  FieldDefinition fieldID=new FieldDefinition();
  fieldID.setName("String_Node_Str");
  fieldID.setTypeName("String_Node_Str");
  fieldID.setSize(15);
  fieldID.setIsPrimaryKey(true);
  fieldID.setIsIdentity(false);
  fieldID.setUnique(false);
  fieldID.setShouldAllowNull(false);
  table.addField(fieldID);
  FieldDefinition fieldDOOR_ID=new FieldDefinition();
  fieldDOOR_ID.setName("String_Node_Str");
  fieldDOOR_ID.setTypeName("String_Node_Str");
  fieldDOOR_ID.setSize(10);
  fieldDOOR_ID.setIsPrimaryKey(true);
  fieldDOOR_ID.setIsIdentity(false);
  fieldDOOR_ID.setUnique(false);
  fieldDOOR_ID.setShouldAllowNull(true);
  table.addField(fieldDOOR_ID);
  ForeignKeyConstraint foreignKeyCMP3_HINGE_CMP3_DOOR=new ForeignKeyConstraint();
  foreignKeyCMP3_HINGE_CMP3_DOOR.setName("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.setTargetTable("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addSourceField("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addTargetField("String_Node_Str");
  table.addForeignKeyConstraint(foreignKeyCMP3_HINGE_CMP3_DOOR);
  return table;
}

Fixed version (ground truth):
public TableDefinition buildCMP3_HINGETable(){
  TableDefinition table=new TableDefinition();
  table.setName("String_Node_Str");
  FieldDefinition fieldID=new FieldDefinition();
  fieldID.setName("String_Node_Str");
  fieldID.setTypeName("String_Node_Str");
  fieldID.setSize(15);
  fieldID.setIsPrimaryKey(true);
  fieldID.setIsIdentity(false);
  fieldID.setUnique(false);
  fieldID.setShouldAllowNull(false);
  table.addField(fieldID);
  FieldDefinition fieldDOOR_ID=new FieldDefinition();
  fieldDOOR_ID.setName("String_Node_Str");
  fieldDOOR_ID.setTypeName("String_Node_Str");
  fieldDOOR_ID.setSize(10);
  fieldDOOR_ID.setIsPrimaryKey(true);
  fieldDOOR_ID.setIsIdentity(false);
  fieldDOOR_ID.setUnique(false);
  fieldDOOR_ID.setShouldAllowNull(false);
  table.addField(fieldDOOR_ID);
  ForeignKeyConstraint foreignKeyCMP3_HINGE_CMP3_DOOR=new ForeignKeyConstraint();
  foreignKeyCMP3_HINGE_CMP3_DOOR.setName("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.setTargetTable("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addSourceField("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addTargetField("String_Node_Str");
  table.addForeignKeyConstraint(foreignKeyCMP3_HINGE_CMP3_DOOR);
  return table;
}
Program: 63432
Project: 63432
Buggy source:
/** 
 * INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.  This implementation works MaxRows and FirstResult into the SQL using DB2's ROWNUMBER() OVER() to filter values if shouldUseRownumFiltering is true.  
 */
@Override public void printSQLSelectStatement(DatabaseCall call,ExpressionSQLPrinter printer,SQLSelectStatement statement){
  int max=0;
  int firstRow=0;
  if (statement.getQuery() != null) {
    max=statement.getQuery().getMaxRows();
    firstRow=statement.getQuery().getFirstResult();
  }
  if (!(this.shouldUseRownumFiltering()) || (!(max > 0) && !(firstRow > 0))) {
    super.printSQLSelectStatement(call,printer,statement);
    return;
  }
 else   if (max > 0) {
    statement.setUseUniqueFieldAliases(true);
    printer.printString("String_Node_Str");
    printer.printString("String_Node_Str");
    call.setFields(statement.printSQL(printer));
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.MAXROW_FIELD);
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
  }
 else {
    statement.setUseUniqueFieldAliases(true);
    printer.printString("String_Node_Str");
    call.setFields(statement.printSQL(printer));
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
  }
  call.setIgnoreFirstRowSetting(true);
  call.setIgnoreMaxResultsSetting(true);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Print the SQL representation of the statement on a stream, storing the fields in the DatabaseCall.  This implementation works MaxRows and FirstResult into the SQL using DB2's ROWNUMBER() OVER() to filter values if shouldUseRownumFiltering is true.  
 */
@Override public void printSQLSelectStatement(DatabaseCall call,ExpressionSQLPrinter printer,SQLSelectStatement statement){
  int max=0;
  int firstRow=0;
  if (statement.getQuery() != null) {
    max=statement.getQuery().getMaxRows();
    firstRow=statement.getQuery().getFirstResult();
  }
  if (!(this.shouldUseRownumFiltering()) || (!(max > 0) && !(firstRow > 0))) {
    super.printSQLSelectStatement(call,printer,statement);
    statement.appendForUpdateClause(printer);
    return;
  }
 else   if (max > 0) {
    statement.setUseUniqueFieldAliases(true);
    printer.printString("String_Node_Str");
    printer.printString("String_Node_Str");
    call.setFields(statement.printSQL(printer));
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.MAXROW_FIELD);
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
    statement.appendForUpdateClause(printer);
  }
 else {
    statement.setUseUniqueFieldAliases(true);
    printer.printString("String_Node_Str");
    call.setFields(statement.printSQL(printer));
    printer.printString("String_Node_Str");
    printer.printParameter(DatabaseCall.FIRSTRESULT_FIELD);
    statement.appendForUpdateClause(printer);
  }
  call.setIgnoreFirstRowSetting(true);
  call.setIgnoreMaxResultsSetting(true);
}
Program: 63434
Project: 63434
Buggy source:
/** 
 * This test checks the situation there ComponentInvocationContext is not available. In this case ApplicationAccess class is used. Mocked ApplicationAccess is used here.
 */
public void testInitUsingApplicationAccess() throws Exception {
  final ApplicationAccessWLS appAccess=new ApplicationAccessWLS(){
    @Override public void initUsingCic() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
      throw new NoSuchMethodException();
    }
  }
;
  assertEquals(appAccess.getApplicationName(Thread.currentThread().getContextClassLoader()),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This test checks the situation there ComponentInvocationContext is not available. In this case ApplicationAccess class is used. Mocked ApplicationAccess is used here.
 */
public void testInitUsingApplicationAccess() throws Exception {
  final ApplicationAccessWLS appAccess=new ApplicationAccessWLS(){
    @Override public boolean initUsingCic(){
      return false;
    }
  }
;
  assertEquals(appAccess.getApplicationName(Thread.currentThread().getContextClassLoader()),"String_Node_Str");
}
Program: 63435
Project: 63435
Buggy source:
@Override public void initUsingCic() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  throw new NoSuchMethodException();
}

Fixed version (ground truth):
@Override public boolean initUsingCic(){
  return false;
}
Program: 63436
Project: 63436
Buggy source:
/** 
 * Create and initialize.
 */
public ApplicationAccessWLS(){
  try {
    initUsingCic();
    LOGGER.fine("String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.log(Level.FINE,"String_Node_Str" + "String_Node_Str",e);
    cicManagerInstance=null;
    try {
      initUsingApplicationAccess();
      LOGGER.fine("String_Node_Str");
    }
 catch (    Exception ex) {
      LOGGER.log(Level.FINE,"String_Node_Str",ex);
      applicationAccessInstance=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Create and initialize.
 */
public ApplicationAccessWLS(){
  if (initUsingCic()) {
    LOGGER.fine("String_Node_Str");
    return;
  }
  cicManagerInstance=null;
  if (initUsingApplicationAccess()) {
    LOGGER.fine("String_Node_Str");
    return;
  }
  applicationAccessInstance=null;
  LOGGER.fine("String_Node_Str");
}
Program: 63437
Project: 63437
Buggy source:
/** 
 * Initializes CIC.
 */
protected void initUsingCic() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  final Class cicManagerClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  final Method getInstance=PrivilegedAccessHelper.getDeclaredMethod(cicManagerClass,"String_Node_Str",new Class[]{});
  cicManagerInstance=PrivilegedAccessHelper.invokeMethod(getInstance,cicManagerClass);
  getCurrentCicMethod=PrivilegedAccessHelper.getMethod(cicManagerClass,"String_Node_Str",new Class[]{},true);
  final Class cicClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  getApplicationIdMethod=PrivilegedAccessHelper.getDeclaredMethod(cicClass,"String_Node_Str",new Class[]{});
}

Fixed version (ground truth):
/** 
 * Initializes CIC. Returns true on success.
 */
protected boolean initUsingCic(){
  if (ApplicationAccessWLS.class.getClassLoader().getResource(CIC_MANAGER_CLASS_NAME) == null) {
    return false;
  }
  try {
    final Class cicManagerClass=PrivilegedAccessHelper.getClassForName(CIC_MANAGER_CLASS_NAME);
    final Method getInstance=PrivilegedAccessHelper.getDeclaredMethod(cicManagerClass,"String_Node_Str",new Class[]{});
    cicManagerInstance=PrivilegedAccessHelper.invokeMethod(getInstance,cicManagerClass);
    getCurrentCicMethod=PrivilegedAccessHelper.getMethod(cicManagerClass,"String_Node_Str",new Class[]{},true);
    final Class cicClass=PrivilegedAccessHelper.getClassForName(CIC_CLASS_NAME);
    getApplicationIdMethod=PrivilegedAccessHelper.getDeclaredMethod(cicClass,"String_Node_Str",new Class[]{});
    return true;
  }
 catch (  ClassNotFoundException|NoSuchMethodException|InvocationTargetException|IllegalAccessException e) {
    LOGGER.log(Level.FINE,"String_Node_Str",e);
    return false;
  }
}
Program: 63438
Project: 63438
Buggy source:
/** 
 * Initializes ApplicationAccess.
 */
protected void initUsingApplicationAccess() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  final Class applicationAccessClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  final Method getApplicationAccessMethod=PrivilegedAccessHelper.getDeclaredMethod(applicationAccessClass,"String_Node_Str",new Class[]{});
  applicationAccessInstance=PrivilegedAccessHelper.invokeMethod(getApplicationAccessMethod,applicationAccessClass);
  final Class[] methodParameterTypes=new Class[]{ClassLoader.class};
  getApplicationNameMethod=PrivilegedAccessHelper.getMethod(applicationAccessClass,"String_Node_Str",methodParameterTypes,true);
  getApplicationVersionMethod=PrivilegedAccessHelper.getMethod(applicationAccessClass,"String_Node_Str",methodParameterTypes,true);
}

Fixed version (ground truth):
/** 
 * Initializes ApplicationAccess.
 */
protected boolean initUsingApplicationAccess(){
  try {
    final Class applicationAccessClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
    final Method getApplicationAccessMethod=PrivilegedAccessHelper.getDeclaredMethod(applicationAccessClass,"String_Node_Str",new Class[]{});
    applicationAccessInstance=PrivilegedAccessHelper.invokeMethod(getApplicationAccessMethod,applicationAccessClass);
    final Class[] methodParameterTypes=new Class[]{ClassLoader.class};
    getApplicationNameMethod=PrivilegedAccessHelper.getMethod(applicationAccessClass,"String_Node_Str",methodParameterTypes,true);
    getApplicationVersionMethod=PrivilegedAccessHelper.getMethod(applicationAccessClass,"String_Node_Str",methodParameterTypes,true);
    return true;
  }
 catch (  ClassNotFoundException|NoSuchMethodException|InvocationTargetException|IllegalAccessException ex) {
    LOGGER.log(Level.FINE,"String_Node_Str",ex);
    return false;
  }
}
Program: 63439
Project: 63439
Buggy source:
public void testDescriptorsSize(){
  List descriptors=((org.eclipse.persistence.jaxb.JAXBContext)jaxbContext).getXMLContext().getSession(0).getProject().getOrderedDescriptors();
  assertEquals(1,descriptors.size());
}

Fixed version (ground truth):
public void testDescriptorsSize(){
  List<ClassDescriptor> descriptors=((org.eclipse.persistence.jaxb.JAXBContext)jaxbContext).getXMLContext().getSession(0).getProject().getOrderedDescriptors();
  assertEquals(2,descriptors.size());
}
Program: 63440
Project: 63440
Buggy source:
/** 
 * Return true if the two TypeMappingInfoObjects should generate the same complex type in the XSD
 */
private static boolean generatesSameComplexType(TypeMappingInfo tmi1,TypeMappingInfo tmi2,ClassLoader loader){
  org.eclipse.persistence.jaxb.xmlmodel.XmlElement element1=null;
  org.eclipse.persistence.jaxb.xmlmodel.XmlElement element2=null;
  if (tmi1.getXmlElement() != null) {
    element1=(org.eclipse.persistence.jaxb.xmlmodel.XmlElement)getXmlElement(tmi1.getXmlElement(),loader);
  }
  if (tmi2.getXmlElement() != null) {
    element2=(org.eclipse.persistence.jaxb.xmlmodel.XmlElement)getXmlElement(tmi2.getXmlElement(),loader);
  }
  Type actualType1=getActualType(tmi1,element1);
  Type actualType2=getActualType(tmi2,element2);
  if (!areTypesEqual(actualType1,actualType2)) {
    return false;
  }
  boolean isXmlList1=isXmlList(tmi1,element1);
  boolean isXmlList2=isXmlList(tmi2,element2);
  if (isXmlList1) {
    if (!isXmlList2) {
      return false;
    }
  }
 else   if (isXmlList2) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Return true if the two TypeMappingInfoObjects should generate the same complex type in the XSD
 */
private static boolean generatesSameComplexType(TypeMappingInfo tmi1,TypeMappingInfo tmi2,ClassLoader loader){
  org.eclipse.persistence.jaxb.xmlmodel.XmlElement element1=null;
  org.eclipse.persistence.jaxb.xmlmodel.XmlElement element2=null;
  if (tmi1.getXmlElement() != null) {
    element1=(org.eclipse.persistence.jaxb.xmlmodel.XmlElement)getXmlElement(tmi1.getXmlElement(),loader);
  }
  if (tmi2.getXmlElement() != null) {
    element2=(org.eclipse.persistence.jaxb.xmlmodel.XmlElement)getXmlElement(tmi2.getXmlElement(),loader);
  }
  Type actualType1=getActualType(tmi1,element1);
  Type actualType2=getActualType(tmi2,element2);
  if (!areTypesEqual(actualType1,actualType2)) {
    return false;
  }
  if (!hasSameClassName(tmi1,tmi2)) {
    return false;
  }
  boolean isXmlList1=isXmlList(tmi1,element1);
  boolean isXmlList2=isXmlList(tmi2,element2);
  if (isXmlList1) {
    if (!isXmlList2) {
      return false;
    }
  }
 else   if (isXmlList2) {
    return false;
  }
  return true;
}
Program: 63441
Project: 63441
Buggy source:
/** 
 * As of EclipseLink 2.6.0 this returns Java SE 7- compatible provider by default on Java SE 7 and Java SE 8+ compatible provider if Java SE 8+ is detected.
 * @return default provider responsible for creating Java SE specific implementationsof  {@link IndirectCollection}s
 */
private static IndirectCollectionsProvider getProvider(){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      final Class support=(Class)AccessController.doPrivileged(new PrivilegedClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader()));
      return AccessController.doPrivileged(new PrivilegedAction<IndirectCollectionsProvider>(){
        @Override public IndirectCollectionsProvider run(){
          try {
            return (IndirectCollectionsProvider)support.newInstance();
          }
 catch (          InstantiationException|IllegalAccessException ex) {
            throw new RuntimeException(ex);
          }
        }
      }
);
    }
 else {
      Class support=PrivilegedAccessHelper.getClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader());
      return (IndirectCollectionsProvider)PrivilegedAccessHelper.newInstanceFromClass(support);
    }
  }
 catch (  Throwable t) {
    AbstractSessionLog.getLog().finest("String_Node_Str");
  }
  return new DefaultProvider();
}

Fixed version (ground truth):
/** 
 * As of EclipseLink 2.6.0 this returns Java SE 7- compatible provider by default on Java SE 7 and Java SE 8+ compatible provider if Java SE 8+ is detected.
 * @return default provider responsible for creating Java SE specific implementationsof  {@link IndirectCollection}s
 */
private static IndirectCollectionsProvider getProvider(){
  try {
    if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
      final Class support=(Class)AccessController.doPrivileged(new PrivilegedClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader()));
      return AccessController.doPrivileged(new PrivilegedAction<IndirectCollectionsProvider>(){
        @Override public IndirectCollectionsProvider run(){
          try {
            return (IndirectCollectionsProvider)support.newInstance();
          }
 catch (          InstantiationException|IllegalAccessException ex) {
            throw new RuntimeException(ex);
          }
        }
      }
);
    }
 else {
      Class support=PrivilegedAccessHelper.getClassForName(JDK8_SUPPORT_PROVIDER,true,IndirectCollectionsFactory.class.getClassLoader());
      return (IndirectCollectionsProvider)PrivilegedAccessHelper.newInstanceFromClass(support);
    }
  }
 catch (  Throwable t) {
    SessionLogEntry sle=new SessionLogEntry(null,t);
    sle.setMessage("String_Node_Str");
    sle.setLevel(SessionLog.FINEST);
    sle.setNameSpace(SessionLog.MISC);
    sle.setDate(null);
    AbstractSessionLog.getLog().log(sle);
  }
  return new DefaultProvider();
}
Program: 63442
Project: 63442
Buggy source:
public TableDefinition buildCMP3_HINGETable(){
  TableDefinition table=new TableDefinition();
  table.setName("String_Node_Str");
  FieldDefinition fieldID=new FieldDefinition();
  fieldID.setName("String_Node_Str");
  fieldID.setTypeName("String_Node_Str");
  fieldID.setSize(15);
  fieldID.setIsPrimaryKey(true);
  fieldID.setIsIdentity(false);
  fieldID.setUnique(false);
  fieldID.setShouldAllowNull(false);
  table.addField(fieldID);
  FieldDefinition fieldDOOR_ID=new FieldDefinition();
  fieldDOOR_ID.setName("String_Node_Str");
  fieldDOOR_ID.setTypeName("String_Node_Str");
  fieldDOOR_ID.setSize(10);
  fieldDOOR_ID.setIsPrimaryKey(true);
  fieldDOOR_ID.setIsIdentity(false);
  fieldDOOR_ID.setUnique(false);
  fieldDOOR_ID.setShouldAllowNull(false);
  table.addField(fieldDOOR_ID);
  ForeignKeyConstraint foreignKeyCMP3_HINGE_CMP3_DOOR=new ForeignKeyConstraint();
  foreignKeyCMP3_HINGE_CMP3_DOOR.setName("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.setTargetTable("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addSourceField("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addTargetField("String_Node_Str");
  table.addForeignKeyConstraint(foreignKeyCMP3_HINGE_CMP3_DOOR);
  return table;
}

Fixed version (ground truth):
public TableDefinition buildCMP3_HINGETable(){
  TableDefinition table=new TableDefinition();
  table.setName("String_Node_Str");
  FieldDefinition fieldID=new FieldDefinition();
  fieldID.setName("String_Node_Str");
  fieldID.setTypeName("String_Node_Str");
  fieldID.setSize(15);
  fieldID.setIsPrimaryKey(true);
  fieldID.setIsIdentity(false);
  fieldID.setUnique(false);
  fieldID.setShouldAllowNull(false);
  table.addField(fieldID);
  FieldDefinition fieldDOOR_ID=new FieldDefinition();
  fieldDOOR_ID.setName("String_Node_Str");
  fieldDOOR_ID.setTypeName("String_Node_Str");
  fieldDOOR_ID.setSize(15);
  fieldDOOR_ID.setIsPrimaryKey(true);
  fieldDOOR_ID.setIsIdentity(false);
  fieldDOOR_ID.setUnique(false);
  fieldDOOR_ID.setShouldAllowNull(false);
  table.addField(fieldDOOR_ID);
  ForeignKeyConstraint foreignKeyCMP3_HINGE_CMP3_DOOR=new ForeignKeyConstraint();
  foreignKeyCMP3_HINGE_CMP3_DOOR.setName("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.setTargetTable("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addSourceField("String_Node_Str");
  foreignKeyCMP3_HINGE_CMP3_DOOR.addTargetField("String_Node_Str");
  table.addForeignKeyConstraint(foreignKeyCMP3_HINGE_CMP3_DOOR);
  return table;
}
Program: 63443
Project: 63443
Buggy source:
/** 
 * Return the "real" attribute value, as opposed to any wrapper. This will trigger the wrapper to instantiate the value. In a weaved policy, this will also call the initial setter method to coordinate the values of the valueholder with the underlying data.
 */
public Object getRealAttributeValueFromObject(Object object,Object attribute){
  boolean wasInstantiated=((ValueHolderInterface)attribute).isInstantiated();
  Object value=super.getRealAttributeValueFromObject(object,attribute);
  if (!wasInstantiated && (value != attribute)) {
    updateValueInObject(object,value,attribute);
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Return the "real" attribute value, as opposed to any wrapper. This will trigger the wrapper to instantiate the value. In a weaved policy, this will also call the initial setter method to coordinate the values of the valueholder with the underlying data.
 */
public Object getRealAttributeValueFromObject(Object object,Object attribute){
  boolean wasInstantiated=attribute != null && attribute instanceof ValueHolderInterface && ((ValueHolderInterface)attribute).isInstantiated();
  Object value=super.getRealAttributeValueFromObject(object,attribute);
  if (!wasInstantiated && (value != attribute)) {
    updateValueInObject(object,value,attribute);
  }
  return value;
}
Program: 63444
Project: 63444
Buggy source:
/** 
 * INTERNAL: Set the session in which we expect this expression to be translated. Stored session shall always be root session.
 */
public void setSession(AbstractSession session){
  this.session=session.getRootSession(null);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Set the session in which we expect this expression to be translated. Stored session shall always be root session.
 */
public void setSession(AbstractSession session){
  if (session != null) {
    this.session=session.getRootSession(null);
  }
 else {
    this.session=null;
  }
}
Program: 63445
Project: 63445
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  suite.addTest(new DDLTestSuite("String_Node_Str"));
  return suite;
}