nus-yam/ex-repair huggingface dataset:
Program: 176555
Project: 176555
Buggy source:
@Test public void onAddColumn() throws Exception {
  String cql_Query="String_Node_Str" + "String_Node_Str";
  executeScript(cql_Query);
  emf=Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
  EntityManager em=emf.createEntityManager();
  UUID timeLineId=UUID.randomUUID();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  onCRUD(em,key);
  em=emf.createEntityManager();
  CassandraPrimeUser result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNotNull(result);
  Assert.assertEquals("String_Node_Str",result.getTweetBody());
  em.remove(result);
  em.flush();
  em.close();
  em=emf.createEntityManager();
  result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNull(result);
  em.close();
}

Fixed version (ground truth):
@Test public void onAddColumn() throws Exception {
  String cql_Query="String_Node_Str" + "String_Node_Str";
  executeScript(cql_Query);
  emf=Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
  EntityManager em=emf.createEntityManager();
  UUID timeLineId=UUID.randomUUID();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  onCRUD(em,key);
  em=emf.createEntityManager();
  Map<String,Client> clients=(Map<String,Client>)em.getDelegate();
  Client client=clients.get(PERSISTENCE_UNIT);
  ((CassandraClientBase)client).setCqlVersion("String_Node_Str");
  CassandraPrimeUser result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNotNull(result);
  Assert.assertEquals("String_Node_Str",result.getTweetBody());
  em.remove(result);
  em.flush();
  em.close();
  em=emf.createEntityManager();
  clients=(Map<String,Client>)em.getDelegate();
  client=clients.get(PERSISTENCE_UNIT);
  ((CassandraClientBase)client).setCqlVersion("String_Node_Str");
  result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNull(result);
  em.close();
}
Program: 176556
Project: 176556
Buggy source:
@Test public void onAlterColumnType() throws Exception {
  String cql_Query="String_Node_Str" + "String_Node_Str";
  executeScript(cql_Query);
  emf=Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
  EntityManager em=emf.createEntityManager();
  UUID timeLineId=UUID.randomUUID();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  onCRUD(em,key);
  em=emf.createEntityManager();
  CassandraPrimeUser result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNotNull(result);
  Assert.assertEquals(currentDate.getTime(),result.getTweetDate().getTime());
  em.remove(result);
  em.flush();
  em.close();
  em=emf.createEntityManager();
  result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNull(result);
  em.close();
}

Fixed version (ground truth):
@Test public void onAlterColumnType() throws Exception {
  String cql_Query="String_Node_Str" + "String_Node_Str";
  executeScript(cql_Query);
  emf=Persistence.createEntityManagerFactory(PERSISTENCE_UNIT);
  EntityManager em=emf.createEntityManager();
  UUID timeLineId=UUID.randomUUID();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  onCRUD(em,key);
  em=emf.createEntityManager();
  Map<String,Client> clients=(Map<String,Client>)em.getDelegate();
  Client client=clients.get(PERSISTENCE_UNIT);
  ((CassandraClientBase)client).setCqlVersion("String_Node_Str");
  CassandraPrimeUser result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNotNull(result);
  Assert.assertEquals(currentDate.getTime(),result.getTweetDate().getTime());
  em.remove(result);
  em.flush();
  em.close();
  em=emf.createEntityManager();
  clients=(Map<String,Client>)em.getDelegate();
  client=clients.get(PERSISTENCE_UNIT);
  ((CassandraClientBase)client).setCqlVersion("String_Node_Str");
  result=em.find(CassandraPrimeUser.class,key);
  Assert.assertNull(result);
  em.close();
}
Program: 176558
Project: 176558
Buggy source:
@Test public void onQuery(){
  EntityManager em=emf.createEntityManager();
  UUID timeLineId=UUID.randomUUID();
  Date currentDate=new Date();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  CassandraEmbeddedAssociation timeLine=new CassandraEmbeddedAssociation(key);
  timeLine.setTweetBody("String_Node_Str");
  timeLine.setTweetDate(new Date());
  UserInfo userInfo=new UserInfo("String_Node_Str","String_Node_Str","String_Node_Str",31);
  timeLine.setUserInfo(userInfo);
  em.persist(timeLine);
  em.clear();
  final String noClause="String_Node_Str";
  Query query=em.createQuery(noClause);
  List<CassandraEmbeddedAssociation> results=query.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getUserInfo().getFirstName());
  Assert.assertEquals(31,results.get(0).getUserInfo().getAge());
  em.remove(timeLine);
  em.clear();
  UserInfo user_Info=em.find(UserInfo.class,"String_Node_Str");
  Assert.assertNull(user_Info);
}

Fixed version (ground truth):
@Test public void onQuery(){
  EntityManager em=emf.createEntityManager();
  Map<String,Client> clients=(Map<String,Client>)em.getDelegate();
  Client client=clients.get("String_Node_Str");
  ((CassandraClientBase)client).setCqlVersion("String_Node_Str");
  UUID timeLineId=UUID.randomUUID();
  Date currentDate=new Date();
  CassandraCompoundKey key=new CassandraCompoundKey("String_Node_Str",1,timeLineId);
  CassandraEmbeddedAssociation timeLine=new CassandraEmbeddedAssociation(key);
  timeLine.setTweetBody("String_Node_Str");
  timeLine.setTweetDate(new Date());
  UserInfo userInfo=new UserInfo("String_Node_Str","String_Node_Str","String_Node_Str",31);
  timeLine.setUserInfo(userInfo);
  em.persist(timeLine);
  em.clear();
  final String noClause="String_Node_Str";
  Query query=em.createQuery(noClause);
  List<CassandraEmbeddedAssociation> results=query.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(1,results.size());
  Assert.assertEquals("String_Node_Str",results.get(0).getUserInfo().getFirstName());
  Assert.assertEquals(31,results.get(0).getUserInfo().getAge());
  em.remove(timeLine);
  em.clear();
  UserInfo user_Info=em.find(UserInfo.class,"String_Node_Str");
  Assert.assertNull(user_Info);
}
Program: 176559
Project: 176559
Buggy source:
/** 
 * Test.
 */
@Test public void test(){
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  CassandraEntitySample entity=new CassandraEntitySample();
  entity.setKey("String_Node_Str");
  entity.setFull_name("String_Node_Str");
  entity.setState("String_Node_Str");
  em.persist(entity);
  CassandraEntitySample findEntity=em.find(CassandraEntitySample.class,123);
  Assert.assertNotNull(findEntity);
  Assert.assertEquals("String_Node_Str",findEntity.getKey());
  Assert.assertEquals("String_Node_Str",findEntity.getFull_name());
  Assert.assertEquals("String_Node_Str",findEntity.getState());
  Assert.assertNull(findEntity.getBirth_date());
}

Fixed version (ground truth):
/** 
 * Test.
 */
@Test public void test(){
  EntityManagerFactoryImpl emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  CassandraEntitySample entity=new CassandraEntitySample();
  entity.setKey("String_Node_Str");
  entity.setFull_name("String_Node_Str");
  entity.setState("String_Node_Str");
  em.persist(entity);
  CassandraEntitySample findEntity=em.find(CassandraEntitySample.class,123);
  Assert.assertNotNull(findEntity);
  Assert.assertEquals("String_Node_Str",findEntity.getKey());
  Assert.assertEquals("String_Node_Str",findEntity.getFull_name());
  Assert.assertEquals("String_Node_Str",findEntity.getState());
  Assert.assertNull(findEntity.getBirth_date());
  emf.close();
}
Program: 176560
Project: 176560
Buggy source:
@Test public void testUpdate(){
  EntityManager em=getEntityManagerFactory().createEntityManager();
  CassandraEntitySample entity=new CassandraEntitySample();
  entity.setBirth_date(new Integer(100112));
  entity.setFull_name("String_Node_Str");
  entity.setKey("String_Node_Str");
  entity.setState("String_Node_Str");
  em.persist(entity);
  String updateQuery="String_Node_Str";
  Query q=em.createQuery(updateQuery);
  q.executeUpdate();
  CassandraEntitySample result=em.find(CassandraEntitySample.class,"String_Node_Str");
  Assert.assertNotNull(result);
  String deleteQuery="String_Node_Str";
  q=em.createQuery(deleteQuery);
  q.executeUpdate();
  result=em.find(CassandraEntitySample.class,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testUpdate(){
  EntityManagerFactory emf=getEntityManagerFactory();
  EntityManager em=emf.createEntityManager();
  CassandraEntitySample entity=new CassandraEntitySample();
  entity.setBirth_date(new Integer(100112));
  entity.setFull_name("String_Node_Str");
  entity.setKey("String_Node_Str");
  entity.setState("String_Node_Str");
  em.persist(entity);
  String updateQuery="String_Node_Str";
  Query q=em.createQuery(updateQuery);
  q.executeUpdate();
  CassandraEntitySample result=em.find(CassandraEntitySample.class,"String_Node_Str");
  Assert.assertNotNull(result);
  String deleteQuery="String_Node_Str";
  q=em.createQuery(deleteQuery);
  q.executeUpdate();
  result=em.find(CassandraEntitySample.class,"String_Node_Str");
  emf.close();
}
Program: 176561
Project: 176561
Buggy source:
public static boolean instanceOfHibernatePersistentCollection(Object o){
  try {
    return o instanceof org.hibernate.collection.spi.PersistentCollection;
  }
 catch (  Exception e) {
    return false;
  }
catch (  NoClassDefFoundError e) {
    return false;
  }
}

Fixed version (ground truth):
public static boolean instanceOfHibernatePersistentCollection(Object o){
  if (o == null)   return false;
  try {
    return o.getClass().isAssignableFrom(PersistentCollection.class);
  }
 catch (  Exception e) {
    return false;
  }
catch (  NoClassDefFoundError e) {
    return false;
  }
}
Program: 176564
Project: 176564
Buggy source:
/** 
 * Adds the entity metadata.
 * @param persistenceUnit the persistence unit
 * @param clazz the clazz
 * @param entityMetadata the entity metadata
 */
public void addEntityMetadata(String persistenceUnit,Class<?> clazz,EntityMetadata entityMetadata){
  Metamodel metamodel=getMetamodelMap().get(persistenceUnit);
  Map<Class<?>,EntityMetadata> entityClassToMetadataMap=((MetamodelImpl)metamodel).getEntityMetadataMap();
  if (entityClassToMetadataMap == null || entityClassToMetadataMap.isEmpty()) {
    entityClassToMetadataMap.put(clazz,entityMetadata);
  }
 else {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + persistenceUnit + "String_Node_Str"+ clazz+ "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Adds the entity metadata.
 * @param persistenceUnit the persistence unit
 * @param clazz the clazz
 * @param entityMetadata the entity metadata
 */
public void addEntityMetadata(String persistenceUnit,Class<?> clazz,EntityMetadata entityMetadata){
  Metamodel metamodel=getMetamodelMap().get(persistenceUnit);
  Map<String,EntityMetadata> entityClassToMetadataMap=((MetamodelImpl)metamodel).getEntityMetadataMap();
  if (entityClassToMetadataMap == null || entityClassToMetadataMap.isEmpty()) {
    entityClassToMetadataMap.put(clazz.getName(),entityMetadata);
  }
 else {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + persistenceUnit + "String_Node_Str"+ clazz+ "String_Node_Str");
  }
}
Program: 176565
Project: 176565
Buggy source:
/** 
 * Adds the entity metadata.
 * @param clazz the clazz
 * @param entityMetadata the entity metadata
 */
public void addEntityMetadata(Class<?> clazz,EntityMetadata entityMetadata){
  getEntityMetadataMap().put(clazz,entityMetadata);
}

Fixed version (ground truth):
/** 
 * Adds the entity metadata.
 * @param clazz the clazz
 * @param entityMetadata the entity metadata
 */
public void addEntityMetadata(Class<?> clazz,EntityMetadata entityMetadata){
  getEntityMetadataMap().put(clazz.getName(),entityMetadata);
}
Program: 176566
Project: 176566
Buggy source:
/** 
 * Gets the entity metadata map.
 * @return the entityMetadataMap
 */
public Map<Class<?>,EntityMetadata> getEntityMetadataMap(){
  if (entityMetadataMap == null) {
    entityMetadataMap=new HashMap<Class<?>,EntityMetadata>();
  }
  return entityMetadataMap;
}

Fixed version (ground truth):
/** 
 * Gets the entity metadata map.
 * @return the entityMetadataMap
 */
public Map<String,EntityMetadata> getEntityMetadataMap(){
  if (entityMetadataMap == null) {
    entityMetadataMap=new HashMap<String,EntityMetadata>();
  }
  return entityMetadataMap;
}
Program: 176567
Project: 176567
Buggy source:
/** 
 * Gets the entity metadata.
 * @param entityClass the entity class
 * @return the entity metadata
 */
public EntityMetadata getEntityMetadata(Class<?> entityClass){
  return getEntityMetadataMap().get(entityClass);
}

Fixed version (ground truth):
/** 
 * Gets the entity metadata.
 * @param entityClass the entity class
 * @return the entity metadata
 */
public EntityMetadata getEntityMetadata(Class<?> entityClass){
  return getEntityMetadataMap().get(entityClass.getName());
}
Program: 176568
Project: 176568
Buggy source:
/** 
 * Instantiates a new metamodel impl.
 */
public MetamodelImpl(){
  super();
  setEntityMetadataMap(new HashMap<Class<?>,EntityMetadata>());
}

Fixed version (ground truth):
/** 
 * Instantiates a new metamodel impl.
 */
public MetamodelImpl(){
  super();
  setEntityMetadataMap(new HashMap<String,EntityMetadata>());
}
Program: 176569
Project: 176569
Buggy source:
/** 
 * Sets the entity metadata map.
 * @param entityMetadataMap the entityMetadataMap to set
 */
public void setEntityMetadataMap(Map<Class<?>,EntityMetadata> entityMetadataMap){
  this.entityMetadataMap=entityMetadataMap;
}

Fixed version (ground truth):
/** 
 * Sets the entity metadata map.
 * @param entityMetadataMap the entityMetadataMap to set
 */
public void setEntityMetadataMap(Map<String,EntityMetadata> entityMetadataMap){
  this.entityMetadataMap=entityMetadataMap;
}
Program: 176570
Project: 176570
Buggy source:
/** 
 * Use this if you want to construct this directly.
 * @param persistenceUnit used to prefix the Cassandra domains
 * @param properties the properties
 */
public EntityManagerFactoryImpl(String persistenceUnit,Map<String,Object> properties){
  if (properties == null) {
    properties=new HashMap<String,Object>();
  }
  properties.put(Constants.PERSISTENCE_UNIT_NAME,persistenceUnit);
  this.properties=properties;
  this.persistenceUnits=persistenceUnit.split(Constants.PERSISTENCE_UNIT_SEPARATOR);
  this.cacheProvider=initSecondLevelCache();
  this.cacheProvider.createCache(Constants.KUNDERA_SECONDARY_CACHE_NAME);
  Set<PersistenceUnitTransactionType> txTypes=new HashSet<PersistenceUnitTransactionType>();
  for (  String pu : persistenceUnits) {
    PersistenceUnitTransactionType txType=KunderaMetadataManager.getPersistenceUnitMetadata(pu).getTransactionType();
    txTypes.add(txType);
  }
  if (txTypes.size() != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else {
    this.transactionType=txTypes.iterator().next();
  }
  this.util=new KunderaPersistenceUnitUtil(cache);
  if (logger.isDebugEnabled())   logger.info("String_Node_Str" + persistenceUnit);
}

Fixed version (ground truth):
/** 
 * Use this if you want to construct this directly.
 * @param persistenceUnit used to prefix the Cassandra domains
 * @param properties the properties
 */
public EntityManagerFactoryImpl(String persistenceUnit,Map<String,Object> properties){
  Map<String,Object> propsMap=new HashMap<String,Object>();
  if (properties != null) {
    propsMap.putAll(properties);
  }
  propsMap.put(Constants.PERSISTENCE_UNIT_NAME,persistenceUnit);
  this.properties=propsMap;
  this.persistenceUnits=persistenceUnit.split(Constants.PERSISTENCE_UNIT_SEPARATOR);
  this.cacheProvider=initSecondLevelCache();
  this.cacheProvider.createCache(Constants.KUNDERA_SECONDARY_CACHE_NAME);
  Set<PersistenceUnitTransactionType> txTypes=new HashSet<PersistenceUnitTransactionType>();
  for (  String pu : persistenceUnits) {
    PersistenceUnitTransactionType txType=KunderaMetadataManager.getPersistenceUnitMetadata(pu).getTransactionType();
    txTypes.add(txType);
  }
  if (txTypes.size() != 1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
 else {
    this.transactionType=txTypes.iterator().next();
  }
  this.util=new KunderaPersistenceUnitUtil(cache);
  if (logger.isDebugEnabled())   logger.info("String_Node_Str" + persistenceUnit);
}
Program: 176571
Project: 176571
Buggy source:
/** 
 * Writes an entity into Persistence cache. (Actual database write is done while flushing)
 */
public void persist(Object e){
  if (e == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  ObjectGraph graph=graphBuilder.getObjectGraph(e,new TransientState());
  Node node=graph.getHeadNode();
  lock.writeLock().lock();
  node.persist();
  flushManager.buildFlushStack(node,com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);
  flush();
  getPersistenceCache().getMainCache().addHeadNode(node);
  lock.writeLock().unlock();
  graph.clear();
  graph=null;
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + e.getClass());
  }
}

Fixed version (ground truth):
/** 
 * Writes an entity into Persistence cache. (Actual database write is done while flushing)
 */
public void persist(Object e){
  if (e == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  getMetadata(e.getClass());
  ObjectGraph graph=graphBuilder.getObjectGraph(e,new TransientState());
  Node node=graph.getHeadNode();
  lock.writeLock().lock();
  node.persist();
  flushManager.buildFlushStack(node,com.impetus.kundera.persistence.context.EventLog.EventType.INSERT);
  flush();
  getPersistenceCache().getMainCache().addHeadNode(node);
  lock.writeLock().unlock();
  graph.clear();
  graph=null;
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + e.getClass());
  }
}
Program: 176572
Project: 176572
Buggy source:
/** 
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  for (  PersonBatchHBaseEntity o : rows) {
    em.remove(o);
  }
  em.close();
  emf.close();
  if (cli != null && cli.isStarted()) {
    cli.stopCluster("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  for (  PersonBatchHBaseEntity o : rows) {
    em.remove(o);
  }
  em.close();
  emf.close();
  if (cli != null) {
    cli.stopCluster("String_Node_Str");
  }
}
Program: 176573
Project: 176573
Buggy source:
/** 
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  for (  Object val : col.values()) {
    em.remove(val);
  }
  em.close();
  emf.close();
  if (cli != null && cli.isStarted()) {
    cli.stopCluster("String_Node_Str");
  }
  LuceneCleanupUtilities.cleanLuceneDirectory("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  for (  Object val : col.values()) {
    em.remove(val);
  }
  em.close();
  emf.close();
  if (cli != null) {
    cli.stopCluster("String_Node_Str");
  }
  LuceneCleanupUtilities.cleanLuceneDirectory("String_Node_Str");
}
Program: 176574
Project: 176574
Buggy source:
@After public void tearDown(){
  em.close();
  emf.close();
  if (cli != null && cli.isStarted()) {
    cli.dropTable("String_Node_Str");
    cli.dropTable("String_Node_Str");
  }
}

Fixed version (ground truth):
@After public void tearDown(){
  em.close();
  emf.close();
  if (cli != null) {
    cli.dropTable("String_Node_Str");
    cli.dropTable("String_Node_Str");
  }
}
Program: 176575
Project: 176575
Buggy source:
private void init(){
  if (!cli.isStarted) {
    cli.startCluster();
  }
  Object p1=prepareHbaseInstance("String_Node_Str",10);
  Object p2=prepareHbaseInstance("String_Node_Str",20);
  Object p3=prepareHbaseInstance("String_Node_Str",15);
  em.persist(p1);
  em.persist(p2);
  em.persist(p3);
  col.put("String_Node_Str",p1);
  col.put("String_Node_Str",p2);
  col.put("String_Node_Str",p3);
}

Fixed version (ground truth):
private void init(){
  cli.startCluster();
  Object p1=prepareHbaseInstance("String_Node_Str",10);
  Object p2=prepareHbaseInstance("String_Node_Str",20);
  Object p3=prepareHbaseInstance("String_Node_Str",15);
  em.persist(p1);
  em.persist(p2);
  em.persist(p3);
  col.put("String_Node_Str",p1);
  col.put("String_Node_Str",p2);
  col.put("String_Node_Str",p3);
}
Program: 176576
Project: 176576
Buggy source:
/** 
 * Tear down.
 * @throws Exception the exception
 */
@After public void tearDown() throws Exception {
  for (  Object val : col.values()) {
    em.remove(val);
  }
  em.close();
  emf.close();
  if (cli != null && cli.isStarted()) {
    cli.dropTable("String_Node_Str");
    cli.stopCluster("String_Node_Str");
  }
  LuceneCleanupUtilities.cleanLuceneDirectory("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Tear down.
 * @throws Exception the exception
 */
@After public void tearDown() throws Exception {
  for (  Object val : col.values()) {
    em.remove(val);
  }
  em.close();
  emf.close();
  if (cli != null) {
    cli.dropTable("String_Node_Str");
    cli.stopCluster("String_Node_Str");
  }
  LuceneCleanupUtilities.cleanLuceneDirectory("String_Node_Str");
}
Program: 176577
Project: 176577
Buggy source:
@AfterClass public static void tearDownAfterClass(){
  emf.close();
  if (cli != null && cli.isStarted()) {
    cli.dropTable("String_Node_Str");
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDownAfterClass(){
  emf.close();
  if (cli != null) {
    cli.dropTable("String_Node_Str");
  }
}
Program: 176578
Project: 176578
Buggy source:
public static void cleanUp(){
  try {
    if (utility != null) {
      utility.cleanupTestDir();
      utility.shutdownMiniCluster();
      FileUtil.fullyDelete(zkDir);
      FileUtil.fullyDelete(masterDir);
      utility=null;
      isStarted=false;
    }
  }
 catch (  IOException e) {
    logger.error(e.getMessage());
  }
catch (  NullPointerException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void cleanUp(){
  try {
    if (utility != null) {
      utility.cleanupTestDir();
      utility.shutdownMiniCluster();
      FileUtil.fullyDelete(zkDir);
      FileUtil.fullyDelete(masterDir);
      utility=null;
    }
  }
 catch (  IOException e) {
    logger.error(e.getMessage());
  }
catch (  NullPointerException e) {
    e.printStackTrace();
  }
catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 176579
Project: 176579
Buggy source:
public static void main(String arg[]){
  HBaseCli cli=new HBaseCli();
}

Fixed version (ground truth):
public static void main(String arg[]){
  HBaseCli cli=new HBaseCli();
  cli.startCluster();
  ;
}
Program: 176580
Project: 176580
Buggy source:
public void startCluster(){
  if (!isStarted) {
    File workingDirectory=new File("String_Node_Str");
    Configuration conf=new Configuration();
    System.setProperty("String_Node_Str",workingDirectory.getAbsolutePath());
    conf.set("String_Node_Str",new File(workingDirectory,"String_Node_Str").getAbsolutePath());
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    try {
      masterDir=new File(workingDirectory,"String_Node_Str");
      conf.set(HConstants.HBASE_DIR,masterDir.toURI().toURL().toString());
    }
 catch (    MalformedURLException e1) {
      logger.error(e1.getMessage());
    }
    Configuration hbaseConf=HBaseConfiguration.create(conf);
    utility=new HBaseTestingUtility(hbaseConf);
    hTablePool=new HTablePool(conf,1);
    try {
      zkCluster=new MiniZooKeeperCluster(conf);
      zkCluster.setDefaultClientPort(2181);
      zkCluster.setTickTime(18000);
      zkDir=new File(utility.getClusterTestDir().toString());
      zkCluster.startup(zkDir);
      utility.setZkCluster(zkCluster);
      utility.startMiniCluster();
      utility.getHBaseCluster().startMaster();
    }
 catch (    Exception e) {
      e.printStackTrace();
      logger.error(e.getMessage());
      throw new RuntimeException(e);
    }
    isStarted=true;
  }
}

Fixed version (ground truth):
public void startCluster(){
  File workingDirectory=new File("String_Node_Str");
  Configuration conf=new Configuration();
  System.setProperty("String_Node_Str",workingDirectory.getAbsolutePath());
  conf.set("String_Node_Str",new File(workingDirectory,"String_Node_Str").getAbsolutePath());
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  conf.set("String_Node_Str","String_Node_Str");
  try {
    masterDir=new File(workingDirectory,"String_Node_Str");
    conf.set(HConstants.HBASE_DIR,masterDir.toURI().toURL().toString());
  }
 catch (  MalformedURLException e1) {
    logger.error(e1.getMessage());
  }
  Configuration hbaseConf=HBaseConfiguration.create(conf);
  utility=new HBaseTestingUtility(hbaseConf);
  if (!checkIfServerRunning()) {
    hTablePool=new HTablePool(conf,1);
    try {
      zkCluster=new MiniZooKeeperCluster(conf);
      zkCluster.setDefaultClientPort(2181);
      zkCluster.setTickTime(18000);
      zkDir=new File(utility.getClusterTestDir().toString());
      zkCluster.startup(zkDir);
      utility.setZkCluster(zkCluster);
      utility.startMiniCluster();
      utility.getHBaseCluster().startMaster();
    }
 catch (    Exception e) {
      e.printStackTrace();
      logger.error(e.getMessage());
      throw new RuntimeException(e);
    }
  }
}
Program: 176581
Project: 176581
Buggy source:
@Override void startServer(){
  if (!cli.isStarted()) {
    cli.startCluster();
  }
}

Fixed version (ground truth):
@Override void startServer(){
  cli.startCluster();
}
Program: 176582
Project: 176582
Buggy source:
@Override void stopServer(){
  if (cli.isStarted()) {
    cli.stopCluster();
  }
}

Fixed version (ground truth):
@Override void stopServer(){
  cli.stopCluster();
}
Program: 176583
Project: 176583
Buggy source:
/** 
 * Starts a new cluster.
 */
public static void startCluster(){
  if (!isStarted) {
    File workingDirectory=new File("String_Node_Str");
    Configuration conf=new Configuration();
    System.setProperty("String_Node_Str",workingDirectory.getAbsolutePath());
    conf.set("String_Node_Str",new File(workingDirectory,"String_Node_Str").getAbsolutePath());
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    try {
      masterDir=new File(workingDirectory,"String_Node_Str");
      conf.set(HConstants.HBASE_DIR,masterDir.toURI().toURL().toString());
    }
 catch (    MalformedURLException e1) {
      logger.error(e1.getMessage());
    }
    Configuration hbaseConf=HBaseConfiguration.create(conf);
    utility=new HBaseTestingUtility(hbaseConf);
    try {
      MiniZooKeeperCluster zkCluster=new MiniZooKeeperCluster(conf);
      zkCluster.setDefaultClientPort(2181);
      zkCluster.setTickTime(18000);
      zkDir=new File(utility.getClusterTestDir().toString());
      zkCluster.startup(zkDir);
      utility.setZkCluster(zkCluster);
      utility.startMiniCluster();
      utility.getHBaseCluster().startMaster();
    }
 catch (    Exception e) {
      logger.error(e.getMessage());
      throw new RuntimeException(e);
    }
    isStarted=true;
  }
}

Fixed version (ground truth):
/** 
 * Starts a new cluster.
 */
public static void startCluster(){
  if (checkIfServerRunning()) {
    File workingDirectory=new File("String_Node_Str");
    Configuration conf=new Configuration();
    System.setProperty("String_Node_Str",workingDirectory.getAbsolutePath());
    conf.set("String_Node_Str",new File(workingDirectory,"String_Node_Str").getAbsolutePath());
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    conf.set("String_Node_Str","String_Node_Str");
    try {
      masterDir=new File(workingDirectory,"String_Node_Str");
      conf.set(HConstants.HBASE_DIR,masterDir.toURI().toURL().toString());
    }
 catch (    MalformedURLException e1) {
      logger.error(e1.getMessage());
    }
    Configuration hbaseConf=HBaseConfiguration.create(conf);
    utility=new HBaseTestingUtility(hbaseConf);
    if (!checkIfServerRunning()) {
      try {
        MiniZooKeeperCluster zkCluster=new MiniZooKeeperCluster(conf);
        zkCluster.setDefaultClientPort(2181);
        zkCluster.setTickTime(18000);
        zkDir=new File(utility.getClusterTestDir().toString());
        zkCluster.startup(zkDir);
        utility.setZkCluster(zkCluster);
        utility.startMiniCluster();
        utility.getHBaseCluster().startMaster();
      }
 catch (      Exception e) {
        logger.error(e.getMessage());
        throw new RuntimeException(e);
      }
    }
  }
}
Program: 176586
Project: 176586
Buggy source:
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  CassandraCli.cassandraSetUp();
  String nativeSql="String_Node_Str" + schema + "String_Node_Str";
  CassandraCli.executeCqlQuery(nativeSql);
}

Fixed version (ground truth):
/** 
 * Sets the up.
 * @throws Exception the exception
 */
@Before public void setUp() throws Exception {
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  CassandraCli.cassandraSetUp();
  String nativeSql="String_Node_Str" + schema + "String_Node_Str";
  CassandraCli.executeCqlQuery(nativeSql);
}
Program: 176587
Project: 176587
Buggy source:
@Test public void testCQLBatch(){
  String useNativeSql="String_Node_Str" + schema;
  EntityManagerFactory emf=getEntityManagerFactory();
  String createColumnFamily="String_Node_Str";
  String batchOps="String_Node_Str";
  EntityManager em=emf.createEntityManager();
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  PelopsClient pc=(PelopsClient)clientMap.get("String_Node_Str");
  pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  Query q=em.createNativeQuery(useNativeSql,CassandraBatchEntity.class);
  q.executeUpdate();
  pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
  q=em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class);
  q.executeUpdate();
  pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
  q=em.createNativeQuery(batchOps,CassandraBatchEntity.class);
  q.executeUpdate();
  q=em.createNativeQuery("String_Node_Str",CassandraBatchEntity.class);
  List<CassandraBatchEntity> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(3,results.size());
  createColumnFamily="String_Node_Str";
  em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class).executeUpdate();
  createColumnFamily="String_Node_Str";
  em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class).executeUpdate();
  batchOps="String_Node_Str";
  em.createNativeQuery(batchOps,CassandraBatchEntity.class).executeUpdate();
}

Fixed version (ground truth):
@Test public void testCQLBatch(){
  String useNativeSql="String_Node_Str" + schema;
  EntityManagerFactory emf=getEntityManagerFactory();
  String createColumnFamily="String_Node_Str";
  String batchOps="String_Node_Str";
  EntityManager em=emf.createEntityManager();
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  PelopsClient pc=(PelopsClient)clientMap.get("String_Node_Str");
  pc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  Query q=em.createNativeQuery(useNativeSql,CassandraBatchEntity.class);
  q.executeUpdate();
  pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
  q=em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class);
  q.executeUpdate();
  pc.setConsistencyLevel(ConsistencyLevel.QUORUM);
  q=em.createNativeQuery(batchOps,CassandraBatchEntity.class);
  q.executeUpdate();
  q=em.createNativeQuery("String_Node_Str",CassandraBatchEntity.class);
  List<CassandraBatchEntity> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(3,results.size());
  createColumnFamily="String_Node_Str";
  em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class).executeUpdate();
  createColumnFamily="String_Node_Str";
  em.createNativeQuery(createColumnFamily,CassandraBatchEntity.class).executeUpdate();
  batchOps="String_Node_Str";
  em.createNativeQuery(batchOps,CassandraBatchEntity.class).executeUpdate();
  emf.close();
}
Program: 176588
Project: 176588
Buggy source:
/** 
 * Sets the up internal.
 * @param persistenceUnitName the new up internal
 * @throws Exception the exception
 */
protected void setUpInternal(String persistenceUnitName) throws Exception {
  userId1="String_Node_Str";
  userId2="String_Node_Str";
  if (RUN_IN_EMBEDDED_MODE) {
    startServer();
  }
  if (AUTO_MANAGE_SCHEMA) {
    CassandraCli.initClient();
    createSchema();
  }
  twitter=new TwitterServiceCassandra(persistenceUnitName);
}

Fixed version (ground truth):
/** 
 * Sets the up internal.
 * @param persistenceUnitName the new up internal
 * @throws Exception the exception
 */
protected void setUpInternal(String persistenceUnitName) throws Exception {
  userId1="String_Node_Str";
  userId2="String_Node_Str";
  if (RUN_IN_EMBEDDED_MODE) {
    startServer();
  }
  if (AUTO_MANAGE_SCHEMA) {
    CassandraCli.initClient();
    createSchema();
  }
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  twitter=new TwitterServiceCassandra(persistenceUnitName);
}
Program: 176590
Project: 176590
Buggy source:
/** 
 * On where clause.
 * @param metadata the metadata
 * @param key the compound key object
 * @param translator the translator
 * @param queryBuilder the query builder
 * @param compoundKey the compound key
 */
private void onWhereClause(EntityMetadata metadata,Object key,CQLTranslator translator,StringBuilder queryBuilder,MetamodelImpl metaModel){
  queryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  if (metaModel.isEmbeddable(metadata.getIdAttribute().getBindableJavaType())) {
    Field[] fields=metadata.getIdAttribute().getBindableJavaType().getDeclaredFields();
    EmbeddableType compoundKey=metaModel.embeddable(metadata.getIdAttribute().getBindableJavaType());
    for (    Field field : fields) {
      if (field != null && !Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers()) && !field.isAnnotationPresent(Transient.class)) {
        Attribute attribute=compoundKey.getAttribute(field.getName());
        String columnName=((AbstractAttribute)attribute).getJPAColumnName();
        translator.buildWhereClause(queryBuilder,columnName,field,key);
      }
    }
  }
 else {
    Attribute attribute=metadata.getIdAttribute();
    translator.buildWhereClause(queryBuilder,CassandraUtilities.getIdColumnName(metadata,getExternalProperties()),key,translator.EQ_CLAUSE);
  }
  queryBuilder.delete(queryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),queryBuilder.length());
}

Fixed version (ground truth):
/** 
 * On where clause.
 * @param metadata the metadata
 * @param key the compound key object
 * @param translator the translator
 * @param queryBuilder the query builder
 * @param compoundKey the compound key
 */
private void onWhereClause(EntityMetadata metadata,Object key,CQLTranslator translator,StringBuilder queryBuilder,MetamodelImpl metaModel){
  queryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  if (metaModel.isEmbeddable(metadata.getIdAttribute().getBindableJavaType())) {
    Field[] fields=metadata.getIdAttribute().getBindableJavaType().getDeclaredFields();
    EmbeddableType compoundKey=metaModel.embeddable(metadata.getIdAttribute().getBindableJavaType());
    for (    Field field : fields) {
      if (field != null && !Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers()) && !field.isAnnotationPresent(Transient.class)) {
        Attribute attribute=compoundKey.getAttribute(field.getName());
        String columnName=((AbstractAttribute)attribute).getJPAColumnName();
        translator.buildWhereClause(queryBuilder,columnName,field,key);
      }
    }
  }
 else {
    Attribute attribute=metadata.getIdAttribute();
    translator.buildWhereClause(queryBuilder,((AbstractAttribute)metadata.getIdAttribute()).getBindableJavaType(),CassandraUtilities.getIdColumnName(metadata,getExternalProperties()),key,translator.EQ_CLAUSE);
  }
  queryBuilder.delete(queryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),queryBuilder.length());
}
Program: 176591
Project: 176591
Buggy source:
/** 
 * Find List of objects based on value   {@columnValue} of column{@columnName}
 * @param m
 * @param columnName
 * @param columnValue
 * @param clazz
 * @param dataHandler
 * @return
 */
protected List<Object> findByRelationQuery(EntityMetadata m,String columnName,Object columnValue,Class clazz,CassandraDataHandler dataHandler){
  CqlResult result=null;
  CQLTranslator translator=new CQLTranslator();
  String selectQuery=translator.SELECTALL_QUERY;
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),m.getTableName()).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnName,columnValue,"String_Node_Str");
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  return executeQuery(selectQueryBuilder.toString(),clazz,null,dataHandler);
}

Fixed version (ground truth):
/** 
 * Find List of objects based on value   {@columnValue} of column{@columnName}
 * @param m
 * @param columnName
 * @param columnValue
 * @param clazz
 * @param dataHandler
 * @return
 */
protected List<Object> findByRelationQuery(EntityMetadata m,String columnName,Object columnValue,Class clazz,CassandraDataHandler dataHandler){
  CQLTranslator translator=new CQLTranslator();
  String selectQuery=translator.SELECTALL_QUERY;
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),m.getTableName()).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnValue.getClass(),columnName,columnValue,"String_Node_Str");
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  return executeQuery(selectQueryBuilder.toString(),clazz,null,dataHandler);
}
Program: 176592
Project: 176592
Buggy source:
/** 
 * Executes query string using cql3.
 * @param cqlQuery
 * @return
 * @throws InvalidRequestException
 * @throws UnavailableException
 * @throws TimedOutException
 * @throws SchemaDisagreementException
 * @throws TException
 */
protected CqlResult executeCQLQuery(String cqlQuery) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException {
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  pooledConnection=getPooledConection(persistenceUnit);
  conn=getConnection(pooledConnection);
  conn.set_cql_version(getCqlVersion());
  try {
    return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
  }
  finally {
    releaseConnection(pooledConnection);
  }
}

Fixed version (ground truth):
/** 
 * Executes query string using cql3.
 * @param cqlQuery
 * @return
 * @throws InvalidRequestException
 * @throws UnavailableException
 * @throws TimedOutException
 * @throws SchemaDisagreementException
 * @throws TException
 */
protected CqlResult executeCQLQuery(String cqlQuery) throws InvalidRequestException, UnavailableException, TimedOutException, SchemaDisagreementException, TException {
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  pooledConnection=getPooledConection(persistenceUnit);
  conn=getConnection(pooledConnection);
  try {
    return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
  }
  finally {
    releaseConnection(pooledConnection);
  }
}
Program: 176596
Project: 176596
Buggy source:
@Test public void test(){
  Token token1=new Token();
  token1.setId("String_Node_Str");
  TokenClient client=new TokenClient();
  client.setClientName("String_Node_Str");
  client.setId("String_Node_Str");
  token1.setClient(client);
  Token token2=new Token();
  token2.setId("String_Node_Str");
  token2.setClient(client);
  em.persist(token1);
  em.persist(token2);
  em.clear();
  Token result=em.find(Token.class,"String_Node_Str");
  Assert.assertNotNull(result);
  Assert.assertNotNull(result.getClient());
  em.clear();
  String query="String_Node_Str";
  Query q=em.createQuery(query);
  List<Token> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(2,results.size());
  Assert.assertNotNull(results.get(0).getClient());
  Assert.assertNotNull(results.get(1).getClient());
  em.clear();
  query="String_Node_Str";
  q=em.createQuery(query);
  List<TokenClient> resultClient=q.getResultList();
  Assert.assertNotNull(resultClient);
  Assert.assertEquals(1,resultClient.size());
  Assert.assertEquals(2,resultClient.get(0).getTokens().size());
}

Fixed version (ground truth):
@Test public void test(){
  Token token1=new Token();
  token1.setId("String_Node_Str");
  TokenClient client=new TokenClient();
  client.setClientName("String_Node_Str");
  client.setId("String_Node_Str");
  token1.setClient(client);
  Token token2=new Token();
  token2.setId("String_Node_Str");
  token2.setClient(client);
  em.persist(token1);
  em.persist(token2);
  em.clear();
  Token result=em.find(Token.class,"String_Node_Str");
  Assert.assertNotNull(result);
  Assert.assertNotNull(result.getClient());
  em.clear();
  String query="String_Node_Str";
  Query q=em.createQuery(query);
  List<Token> results=q.getResultList();
  Assert.assertNotNull(results);
  Assert.assertEquals(2,results.size());
  Assert.assertNotNull(results.get(0).getClient());
  Assert.assertNotNull(results.get(1).getClient());
  em.clear();
  query="String_Node_Str";
  q=em.createQuery(query);
  List<TokenClient> resultClient=q.getResultList();
  Assert.assertNotNull(resultClient);
  Assert.assertEquals(1,resultClient.size());
  Assert.assertEquals(2,resultClient.get(0).getTokens().size());
  em.clear();
}
Program: 176598
Project: 176598
Buggy source:
/** 
 * CompositeUserDataType
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
  CassandraCli.dropKeySpace("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * CompositeUserDataType
 * @throws java.lang.Exception
 */
@After public void tearDown() throws Exception {
}
Program: 176600
Project: 176600
Buggy source:
/** 
 * Gets the client instance.
 * @return the client instance
 */
@Override public Client getClientInstance(){
  if (isThreadSafe()) {
    logger.info("String_Node_Str" + persistenceUnit);
    if (client == null) {
      client=instantiateClient(persistenceUnit);
    }
  }
 else {
    logger.debug("String_Node_Str" + persistenceUnit);
    client=instantiateClient(persistenceUnit);
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Gets the client instance.
 * @return the client instance
 */
@Override public Client getClientInstance(){
  if (isThreadSafe()) {
    logger.info("String_Node_Str" + persistenceUnit);
    if (client == null) {
      client=instantiateClient(persistenceUnit);
    }
  }
 else {
    logger.debug("String_Node_Str" + persistenceUnit);
    return instantiateClient(persistenceUnit);
  }
  return client;
}
Program: 176602
Project: 176602
Buggy source:
/** 
 * Process.
 * @param clazz the clazz
 * @param externalProperties
 * @return the entity metadata
 */
public EntityMetadata buildEntityMetadata(Class<?> clazz){
  EntityMetadata metadata=new EntityMetadata(clazz);
  validate(clazz);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + clazz);
  for (  MetadataProcessor processor : metadataProcessors) {
    checkForRDBMS(metadata);
    checkForNeo4J(metadata);
    processor.process(clazz,metadata);
    metadata=belongsToPersistenceUnit(metadata);
    if (metadata == null) {
      break;
    }
  }
  return metadata;
}

Fixed version (ground truth):
/** 
 * Process.
 * @param clazz the clazz
 * @param externalProperties
 * @return the entity metadata
 */
public EntityMetadata buildEntityMetadata(Class<?> clazz){
  EntityMetadata metadata=new EntityMetadata(clazz);
  validate(clazz);
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + clazz);
  for (  MetadataProcessor processor : metadataProcessors) {
    checkForRDBMS(metadata);
    checkForNeo4J(metadata);
    processor.process(clazz,metadata);
    metadata=belongsToPersistenceUnit(metadata);
    if (metadata == null) {
      break;
    }
    if (MetadataUtils.isSchemaAttributeRequired(metadata.getPersistenceUnit()) && StringUtils.isBlank(metadata.getSchema())) {
      if (log.isErrorEnabled()) {
        log.error("String_Node_Str" + metadata.getTableName() + "String_Node_Str");
      }
      throw new InvalidEntityDefinitionException("String_Node_Str" + metadata.getTableName() + "String_Node_Str");
    }
  }
  return metadata;
}
Program: 176603
Project: 176603
Buggy source:
/** 
 * Populate metadata.
 * @param < X > the generic type
 * @param < T > the generic type
 * @param metadata the metadata
 * @param clazz the clazz
 */
private <X extends Class,T extends Object>void populateMetadata(EntityMetadata metadata,Class<X> clazz,Map puProperties){
  Table table=clazz.getAnnotation(Table.class);
  boolean isEmbeddable=false;
  metadata.setTableName(table.name());
  addNamedNativeQueryMetadata(clazz);
  String schemaStr=table.schema();
  MetadataUtils.setSchemaAndPersistenceUnit(metadata,schemaStr,puProperties);
  if (metadata.getPersistenceUnit() != null) {
    MetaModelBuilder<X,T> metaModelBuilder=KunderaMetadata.INSTANCE.getApplicationMetadata().getMetaModelBuilder(metadata.getPersistenceUnit());
    metaModelBuilder.process(clazz);
    for (    Field f : clazz.getDeclaredFields()) {
      if (f != null && !Modifier.isStatic(f.getModifiers()) && !Modifier.isTransient(f.getModifiers()) && !f.isAnnotationPresent(Transient.class)) {
        metaModelBuilder.construct(clazz,f);
        onIdAttribute(metaModelBuilder,metadata,clazz,f);
        onFamilyType(metadata,clazz,f);
        onJPAColumnMapping(metaModelBuilder,metadata,f);
        addRelationIntoMetadata(clazz,f,metadata);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Populate metadata.
 * @param < X > the generic type
 * @param < T > the generic type
 * @param metadata the metadata
 * @param clazz the clazz
 */
private <X extends Class,T extends Object>void populateMetadata(EntityMetadata metadata,Class<X> clazz,Map puProperties){
  Table table=clazz.getAnnotation(Table.class);
  metadata.setTableName(table.name());
  addNamedNativeQueryMetadata(clazz);
  String schemaStr=table.schema();
  MetadataUtils.setSchemaAndPersistenceUnit(metadata,schemaStr,puProperties);
  if (metadata.getPersistenceUnit() != null) {
    MetaModelBuilder<X,T> metaModelBuilder=KunderaMetadata.INSTANCE.getApplicationMetadata().getMetaModelBuilder(metadata.getPersistenceUnit());
    metaModelBuilder.process(clazz);
    for (    Field f : clazz.getDeclaredFields()) {
      if (f != null && !Modifier.isStatic(f.getModifiers()) && !Modifier.isTransient(f.getModifiers()) && !f.isAnnotationPresent(Transient.class)) {
        metaModelBuilder.construct(clazz,f);
        onIdAttribute(metaModelBuilder,metadata,clazz,f);
        onFamilyType(metadata,clazz,f);
        onJPAColumnMapping(metaModelBuilder,metadata,f);
        addRelationIntoMetadata(clazz,f,metadata);
      }
    }
  }
}
Program: 176604
Project: 176604
Buggy source:
/** 
 * Close.
 */
public void close(){
  nodes.clear();
  nodes=null;
  closed=true;
  externalProperties=null;
}

Fixed version (ground truth):
/** 
 * Close.
 */
public void close(){
  clear();
  closed=true;
}