nus-yam/ex-repair huggingface dataset:
Program: 176495
Project: 176495
Buggy source:
@Test public void testSingleEntityCRUD_EmCleared(){
  final SampleEntity entity=new SampleEntity();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setCity("String_Node_Str");
  em.persist(entity);
  em.clear();
  SampleEntity found=em.find(SampleEntity.class,1);
  assertSampleEntity(found);
  found.setName("String_Node_Str");
  found.setCity("String_Node_Str");
  em.clear();
  em.merge(found);
  SampleEntity foundAfterMerge=em.find(SampleEntity.class,1);
  assertUpdatedSampleEntity(foundAfterMerge);
  em.clear();
  em.remove(foundAfterMerge);
  SampleEntity foundAfterDeletion=em.find(SampleEntity.class,1);
  Assert.assertNull(foundAfterDeletion);
}

Fixed version (ground truth):
@Test public void testSingleEntityCRUD_EmCleared(){
  final SampleEntity entity=new SampleEntity();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setCity("String_Node_Str");
  em.persist(entity);
  Assert.assertTrue(em.contains(entity));
  em.clear();
  Assert.assertFalse(em.contains(entity));
  SampleEntity found=em.find(SampleEntity.class,1,new HashMap<String,Object>());
  assertSampleEntity(found);
  found.setName("String_Node_Str");
  found.setCity("String_Node_Str");
  em.clear();
  em.merge(found);
  SampleEntity foundAfterMerge=em.find(SampleEntity.class,1);
  assertUpdatedSampleEntity(foundAfterMerge);
  SampleEntity se=(SampleEntity)DummyDatabase.INSTANCE.getSchema("String_Node_Str").getTable("String_Node_Str").getRecord(new Integer(1));
  se.setCity("String_Node_Str");
  em.refresh(foundAfterMerge);
  SampleEntity found2=em.find(SampleEntity.class,1);
  Assert.assertEquals("String_Node_Str",found2.getCity());
  em.detach(foundAfterMerge);
  em.clear();
  found=em.find(SampleEntity.class,1);
  em.clear();
  em.remove(found);
  SampleEntity foundAfterDeletion=em.find(SampleEntity.class,1);
  Assert.assertNull(foundAfterDeletion);
}
Program: 176496
Project: 176496
Buggy source:
@Test public void testSingleEntityCRUD_EmNotCleared(){
  final SampleEntity entity=new SampleEntity();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setCity("String_Node_Str");
  em.persist(entity);
  SampleEntity found=em.find(SampleEntity.class,1);
  assertSampleEntity(found);
  found.setName("String_Node_Str");
  found.setCity("String_Node_Str");
  em.merge(found);
  SampleEntity foundAfterMerge=em.find(SampleEntity.class,1);
  assertUpdatedSampleEntity(foundAfterMerge);
  em.remove(foundAfterMerge);
  SampleEntity foundAfterDeletion=em.find(SampleEntity.class,1);
  Assert.assertNull(foundAfterDeletion);
}

Fixed version (ground truth):
@Test public void testSingleEntityCRUD_EmNotCleared(){
  final SampleEntity entity=new SampleEntity();
  entity.setKey(1);
  entity.setName("String_Node_Str");
  entity.setCity("String_Node_Str");
  em.persist(entity);
  SampleEntity found=em.find(SampleEntity.class,1);
  assertSampleEntity(found);
  Assert.assertTrue(em.contains(found));
  found.setName("String_Node_Str");
  found.setCity("String_Node_Str");
  em.merge(found);
  SampleEntity foundAfterMerge=em.find(SampleEntity.class,1);
  assertUpdatedSampleEntity(foundAfterMerge);
  em.flush();
  em.remove(foundAfterMerge);
  SampleEntity foundAfterDeletion=em.find(SampleEntity.class,1);
  Assert.assertNull(foundAfterDeletion);
}
Program: 176497
Project: 176497
Buggy source:
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> rlHolders){
  DummySchema schema=DummyDatabase.INSTANCE.getSchema(entityMetadata.getSchema());
  DummyTable table=new DummyTable();
  table.addRecord(id,entity);
  if (schema == null) {
    schema=new DummySchema();
    schema.addTable(entityMetadata.getTableName(),table);
    DummyDatabase.INSTANCE.addSchema(entityMetadata.getSchema(),schema);
  }
 else {
    schema.addTable(entityMetadata.getTableName(),table);
  }
}

Fixed version (ground truth):
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> rlHolders){
  DummySchema schema=DummyDatabase.INSTANCE.getSchema(entityMetadata.getSchema());
  if (schema == null) {
    schema=new DummySchema();
    DummyTable table=new DummyTable();
    table.addRecord(id,entity);
    schema.addTable(entityMetadata.getTableName(),table);
    DummyDatabase.INSTANCE.addSchema(entityMetadata.getSchema(),schema);
  }
 else {
    DummyTable table=schema.getTable(entityMetadata.getTableName());
    if (table == null) {
      table=new DummyTable();
    }
    table.addRecord(id,entity);
    schema.addTable(entityMetadata.getTableName(),table);
  }
}
Program: 176499
Project: 176499
Buggy source:
/** 
 * Close.
 */
void close(){
  doFlush();
  eventDispatcher=null;
  if (clientMap != null && !clientMap.isEmpty()) {
    for (    Client client : clientMap.values()) {
      client.close();
    }
    clientMap.clear();
    clientMap=null;
  }
  closed=true;
}

Fixed version (ground truth):
/** 
 * Close.
 */
void close(){
  doFlush();
  eventDispatcher=null;
  if (clientMap != null && !clientMap.isEmpty()) {
    for (    Client client : clientMap.values()) {
      client.close();
    }
    clientMap.clear();
    clientMap=null;
  }
  KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().clearProxies();
  closed=true;
}
Program: 176500
Project: 176500
Buggy source:
/** 
 * @param < E >
 * @param entityMetadata
 * @param e
 */
private <E>void setProxyOwners(EntityMetadata entityMetadata,E e){
  KunderaProxy kunderaProxy=KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().getProxy();
  if (kunderaProxy != null) {
    kunderaProxy.getKunderaLazyInitializer().setOwner(e);
  }
}

Fixed version (ground truth):
/** 
 * @param < E >
 * @param entityMetadata
 * @param e
 */
private <E>void setProxyOwners(EntityMetadata entityMetadata,E e){
  Object entityId=PropertyAccessorHelper.getId(e,entityMetadata);
  for (  Relation r : entityMetadata.getRelations()) {
    String entityName=entityMetadata.getEntityClazz().getName() + "String_Node_Str" + entityId+ "String_Node_Str"+ r.getProperty().getName();
    KunderaProxy kunderaProxy=KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().getProxy(entityName);
    if (kunderaProxy != null) {
      kunderaProxy.getKunderaLazyInitializer().setOwner(e);
    }
  }
}
Program: 176501
Project: 176501
Buggy source:
KunderaProxy getProxy();

Fixed version (ground truth):
/** 
 * Returns proxy instance for a given entity name, null if none exists
 * @param entityName
 * @return
 */
KunderaProxy getProxy(String entityName);
Program: 176502
Project: 176502
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (constructed) {
    String methodName=method.getName();
    int params=args.length;
    if (params == 0) {
      if (isUninitialized() && method.equals(getIdentifierMethod)) {
        return getIdentifier();
      }
 else       if ("String_Node_Str".equals(methodName)) {
        return this;
      }
    }
    Object target=getImplementation();
    String[] strArr=entityName.split("String_Node_Str");
    String fieldName=strArr[1];
    if (owner != null) {
      EntityMetadata m=KunderaMetadataManager.getEntityMetadata(owner.getClass());
      Relation r=m.getRelation(fieldName);
      PropertyAccessorHelper.set(owner,r.getProperty(),target);
    }
    try {
      final Object returnValue;
      if (method.isAccessible()) {
        if (!method.getDeclaringClass().isInstance(target)) {
          throw new ClassCastException(target.getClass().getName());
        }
        returnValue=method.invoke(target,args);
      }
 else {
        if (!method.isAccessible()) {
          method.setAccessible(true);
        }
        returnValue=method.invoke(target,args);
      }
      return ((returnValue == target) ? proxy : returnValue);
    }
 catch (    InvocationTargetException ite) {
      throw new LazyInitializationException(ite);
    }
  }
 else {
    throw new LazyInitializationException("String_Node_Str" + method.getName());
  }
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (constructed) {
    String methodName=method.getName();
    int params=args.length;
    if (params == 0) {
      if (isUninitialized() && method.equals(getIdentifierMethod)) {
        return getIdentifier();
      }
 else       if ("String_Node_Str".equals(methodName)) {
        return this;
      }
    }
    Object target=getImplementation();
    String[] strArr=entityName.split("String_Node_Str");
    String fieldName=strArr[1];
    if (owner != null) {
      EntityMetadata m=KunderaMetadataManager.getEntityMetadata(owner.getClass());
      Relation r=m.getRelation(fieldName);
      PropertyAccessorHelper.set(owner,r.getProperty(),target);
      if (r.getBiDirectionalField() != null && method.getReturnType().equals(m.getEntityClazz())) {
        PropertyAccessorHelper.set(target,r.getBiDirectionalField(),owner);
      }
      proxy=target;
    }
    try {
      final Object returnValue;
      if (method.isAccessible()) {
        if (!method.getDeclaringClass().isInstance(target)) {
          throw new ClassCastException(target.getClass().getName());
        }
        returnValue=method.invoke(target,args);
      }
 else {
        if (!method.isAccessible()) {
          method.setAccessible(true);
        }
        returnValue=method.invoke(target,args);
      }
      return ((returnValue == target) ? proxy : returnValue);
    }
 catch (    InvocationTargetException ite) {
      throw new LazyInitializationException(ite);
    }
  }
 else {
    throw new LazyInitializationException("String_Node_Str" + method.getName());
  }
}
Program: 176503
Project: 176503
Buggy source:
@Override public KunderaProxy getProxy(){
  return kunderaProxy;
}

Fixed version (ground truth):
@Override public KunderaProxy getProxy(String entityName){
  return proxies.get(entityName);
}
Program: 176504
Project: 176504
Buggy source:
@After public void tearDown(){
  if (em != null)   em.close();
  if (emf != null)   emf.close();
}

Fixed version (ground truth):
@After public void tearDown(){
  if (em != null)   em.close();
  if (emf != null)   emf.close();
  dropDatabase();
}
Program: 176507
Project: 176507
Buggy source:
@After public void tearDown(){
  if (em != null)   em.close();
  if (emf != null)   emf.close();
}

Fixed version (ground truth):
@After public void tearDown(){
  if (em != null)   em.close();
  if (emf != null)   emf.close();
  dropDatabase();
}
Program: 176509
Project: 176509
Buggy source:
/** 
 * Close.
 */
void close(){
  doFlush();
  eventDispatcher=null;
  if (clientMap != null && !clientMap.isEmpty()) {
    for (    Client client : clientMap.values()) {
      client.close();
    }
    clientMap.clear();
    clientMap=null;
  }
  closed=true;
}

Fixed version (ground truth):
/** 
 * Close.
 */
void close(){
  doFlush();
  eventDispatcher=null;
  if (clientMap != null && !clientMap.isEmpty()) {
    for (    Client client : clientMap.values()) {
      client.close();
    }
    clientMap.clear();
    clientMap=null;
  }
  KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().clearProxies();
  closed=true;
}
Program: 176510
Project: 176510
Buggy source:
/** 
 * @param < E >
 * @param entityMetadata
 * @param e
 */
private <E>void setProxyOwners(EntityMetadata entityMetadata,E e){
  KunderaProxy kunderaProxy=KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().getProxy();
  if (kunderaProxy != null) {
    kunderaProxy.getKunderaLazyInitializer().setOwner(e);
  }
}

Fixed version (ground truth):
/** 
 * @param < E >
 * @param entityMetadata
 * @param e
 */
private <E>void setProxyOwners(EntityMetadata entityMetadata,E e){
  Object entityId=PropertyAccessorHelper.getId(e,entityMetadata);
  for (  Relation r : entityMetadata.getRelations()) {
    String entityName=entityMetadata.getEntityClazz().getName() + "String_Node_Str" + entityId+ "String_Node_Str"+ r.getProperty().getName();
    KunderaProxy kunderaProxy=KunderaMetadata.INSTANCE.getCoreMetadata().getLazyInitializerFactory().getProxy(entityName);
    if (kunderaProxy != null) {
      kunderaProxy.getKunderaLazyInitializer().setOwner(e);
    }
  }
}
Program: 176511
Project: 176511
Buggy source:
KunderaProxy getProxy();

Fixed version (ground truth):
/** 
 * Returns proxy instance for a given entity name, null if none exists
 * @param entityName
 * @return
 */
KunderaProxy getProxy(String entityName);
Program: 176512
Project: 176512
Buggy source:
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (constructed) {
    String methodName=method.getName();
    int params=args.length;
    if (params == 0) {
      if (isUninitialized() && method.equals(getIdentifierMethod)) {
        return getIdentifier();
      }
 else       if ("String_Node_Str".equals(methodName)) {
        return this;
      }
    }
    Object target=getImplementation();
    String[] strArr=entityName.split("String_Node_Str");
    String fieldName=strArr[1];
    if (owner != null) {
      EntityMetadata m=KunderaMetadataManager.getEntityMetadata(owner.getClass());
      Relation r=m.getRelation(fieldName);
      PropertyAccessorHelper.set(owner,r.getProperty(),target);
    }
    try {
      final Object returnValue;
      if (method.isAccessible()) {
        if (!method.getDeclaringClass().isInstance(target)) {
          throw new ClassCastException(target.getClass().getName());
        }
        returnValue=method.invoke(target,args);
      }
 else {
        if (!method.isAccessible()) {
          method.setAccessible(true);
        }
        returnValue=method.invoke(target,args);
      }
      return ((returnValue == target) ? proxy : returnValue);
    }
 catch (    InvocationTargetException ite) {
      throw new LazyInitializationException(ite);
    }
  }
 else {
    throw new LazyInitializationException("String_Node_Str" + method.getName());
  }
}

Fixed version (ground truth):
@Override public Object invoke(Object proxy,Method method,Object[] args) throws Throwable {
  if (constructed) {
    String methodName=method.getName();
    int params=args.length;
    if (params == 0) {
      if (isUninitialized() && method.equals(getIdentifierMethod)) {
        return getIdentifier();
      }
 else       if ("String_Node_Str".equals(methodName)) {
        return this;
      }
    }
    Object target=getImplementation();
    String[] strArr=entityName.split("String_Node_Str");
    String fieldName=strArr[1];
    if (owner != null) {
      EntityMetadata m=KunderaMetadataManager.getEntityMetadata(owner.getClass());
      Relation r=m.getRelation(fieldName);
      PropertyAccessorHelper.set(owner,r.getProperty(),target);
      if (r.getBiDirectionalField() != null && method.getReturnType().equals(m.getEntityClazz())) {
        PropertyAccessorHelper.set(target,r.getBiDirectionalField(),owner);
      }
      proxy=target;
    }
    try {
      final Object returnValue;
      if (method.isAccessible()) {
        if (!method.getDeclaringClass().isInstance(target)) {
          throw new ClassCastException(target.getClass().getName());
        }
        returnValue=method.invoke(target,args);
      }
 else {
        if (!method.isAccessible()) {
          method.setAccessible(true);
        }
        returnValue=method.invoke(target,args);
      }
      return ((returnValue == target) ? proxy : returnValue);
    }
 catch (    InvocationTargetException ite) {
      throw new LazyInitializationException(ite);
    }
  }
 else {
    throw new LazyInitializationException("String_Node_Str" + method.getName());
  }
}
Program: 176513
Project: 176513
Buggy source:
@Override public KunderaProxy getProxy(){
  return kunderaProxy;
}

Fixed version (ground truth):
@Override public KunderaProxy getProxy(String entityName){
  return proxies.get(entityName);
}
Program: 176517
Project: 176517
Buggy source:
/** 
 * Add tableGenerator to table info.
 * @param appMetadata
 * @param persistenceUnit
 * @param tableInfos
 * @param entityMetadata
 * @param idClassName
 * @param idName
 * @param isCompositeId
 */
private void addTableGenerator(ApplicationMetadata appMetadata,String persistenceUnit,List<TableInfo> tableInfos,EntityMetadata entityMetadata,Class idClassName,String idName,boolean isCompositeId){
  Metamodel metamodel=appMetadata.getMetamodel(persistenceUnit);
  IdDiscriptor keyValue=((MetamodelImpl)metamodel).getKeyValue(entityMetadata.getEntityClazz().getName());
  if (keyValue != null && keyValue.getTableDiscriptor() != null) {
    TableInfo tableGeneratorDiscriptor=new TableInfo(keyValue.getTableDiscriptor().getTable(),false,"String_Node_Str",String.class,idName,isCompositeId);
    if (!tableInfos.contains(tableGeneratorDiscriptor)) {
      tableGeneratorDiscriptor.addColumnInfo(getJoinColumn(tableGeneratorDiscriptor,keyValue.getTableDiscriptor().getValueColumnName(),Long.class));
      tableInfos.add(tableGeneratorDiscriptor);
    }
  }
}

Fixed version (ground truth):
/** 
 * Add tableGenerator to table info.
 * @param appMetadata
 * @param persistenceUnit
 * @param tableInfos
 * @param entityMetadata
 * @param idClassName
 * @param idName
 * @param isCompositeId
 */
private void addTableGenerator(ApplicationMetadata appMetadata,String persistenceUnit,List<TableInfo> tableInfos,EntityMetadata entityMetadata,Class idClassName,String idName){
  Metamodel metamodel=appMetadata.getMetamodel(persistenceUnit);
  IdDiscriptor keyValue=((MetamodelImpl)metamodel).getKeyValue(entityMetadata.getEntityClazz().getName());
  if (keyValue != null && keyValue.getTableDiscriptor() != null) {
    TableInfo tableGeneratorDiscriptor=new TableInfo(keyValue.getTableDiscriptor().getTable(),"String_Node_Str",String.class,idName);
    if (!tableInfos.contains(tableGeneratorDiscriptor)) {
      tableGeneratorDiscriptor.addColumnInfo(getJoinColumn(tableGeneratorDiscriptor,keyValue.getTableDiscriptor().getValueColumnName(),Long.class));
      tableInfos.add(tableGeneratorDiscriptor);
    }
  }
}
Program: 176518
Project: 176518
Buggy source:
public String getIdColumnName(){
  return idColumnName;
}

Fixed version (ground truth):
/** 
 * Returns name of id attribute.
 * @return id attribute name.
 */
public String getIdColumnName(){
  return idColumnName;
}
Program: 176519
Project: 176519
Buggy source:
/** 
 * Instantiates a new table info.
 * @param tableName the table name
 * @param isIndexable the is indexable
 * @param tableSchemaType the table schema type
 * @param idClassType the id class type
 */
public TableInfo(String tableName,boolean isIndexable,String tableSchemaType,Class idClassType,String idColumnName,boolean isCompositeId){
  this.tableName=tableName;
  this.isIndexable=isIndexable;
  this.type=tableSchemaType;
  this.idClazz=idClassType;
  this.idColumnName=idColumnName;
  this.isCompositeId=isCompositeId;
}

Fixed version (ground truth):
/** 
 * Instantiates a new table info.
 * @param tableName the table name
 * @param isIndexable the is indexable
 * @param tableSchemaType the table schema type
 * @param idClassType the id class type
 */
public TableInfo(String tableName,String tableSchemaType,Class idClassType,String idColumnName){
  this.tableName=tableName;
  this.type=tableSchemaType;
  this.idClazz=idClassType;
  this.idColumnName=idColumnName;
}
Program: 176520
Project: 176520
Buggy source:
@Override public String toString(){
  StringBuilder strBuilder=new StringBuilder("String_Node_Str");
  strBuilder.append(idClazz);
  strBuilder.append("String_Node_Str");
  strBuilder.append(tableName);
  strBuilder.append("String_Node_Str");
  strBuilder.append(type);
  strBuilder.append("String_Node_Str");
  strBuilder.append(isIndexable);
  return strBuilder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder strBuilder=new StringBuilder("String_Node_Str");
  strBuilder.append(idClazz);
  strBuilder.append("String_Node_Str");
  strBuilder.append(tableName);
  strBuilder.append("String_Node_Str");
  strBuilder.append(type);
  return strBuilder.toString();
}
Program: 176521
Project: 176521
Buggy source:
public List<IndexInfo> getColumnsToBeIndexed(){
  return this.columnToBeIndexed;
}

Fixed version (ground truth):
/** 
 * Returns list of index information object.
 * @return
 */
public List<IndexInfo> getColumnsToBeIndexed(){
  return this.columnToBeIndexed;
}
Program: 176522
Project: 176522
Buggy source:
/** 
 * update method update schema and table for the list of tableInfos
 * @param tableInfos list of TableInfos.
 */
protected void update(List<TableInfo> tableInfos){
  for (  TableInfo tableInfo : tableInfos) {
    DBObject options=setCollectionProperties(tableInfo);
    getDBName();
    DB db=mongo.getDB(databaseName);
    DBCollection collection=null;
    if (!db.collectionExists(tableInfo.getTableName())) {
      collection=db.createCollection(tableInfo.getTableName(),options);
    }
    collection=collection != null ? collection : db.getCollection(tableInfo.getTableName());
    boolean isCappedCollection=isCappedCollection(tableInfo);
    if (tableInfo.isIndexable() && !isCappedCollection) {
      createIndexes(tableInfo,collection);
    }
  }
}

Fixed version (ground truth):
/** 
 * update method update schema and table for the list of tableInfos
 * @param tableInfos list of TableInfos.
 */
protected void update(List<TableInfo> tableInfos){
  for (  TableInfo tableInfo : tableInfos) {
    DBObject options=setCollectionProperties(tableInfo);
    getDBName();
    DB db=mongo.getDB(databaseName);
    DBCollection collection=null;
    if (!db.collectionExists(tableInfo.getTableName())) {
      collection=db.createCollection(tableInfo.getTableName(),options);
    }
    collection=collection != null ? collection : db.getCollection(tableInfo.getTableName());
    boolean isCappedCollection=isCappedCollection(tableInfo);
    if (!isCappedCollection) {
      createIndexes(tableInfo,collection);
    }
  }
}
Program: 176523
Project: 176523
Buggy source:
/** 
 * create method creates schema and table for the list of tableInfos.
 * @param tableInfos list of TableInfos.
 */
protected void create(List<TableInfo> tableInfos){
  for (  TableInfo tableInfo : tableInfos) {
    DBObject options=setCollectionProperties(tableInfo);
    getDBName();
    DB db=mongo.getDB(databaseName);
    if (db.collectionExists(tableInfo.getTableName())) {
      db.getCollection(tableInfo.getTableName()).drop();
    }
    DBCollection collection=db.createCollection(tableInfo.getTableName(),options);
    boolean isCappedCollection=isCappedCollection(tableInfo);
    if (tableInfo.isIndexable() && !isCappedCollection) {
      createIndexes(tableInfo,collection);
    }
  }
}

Fixed version (ground truth):
/** 
 * create method creates schema and table for the list of tableInfos.
 * @param tableInfos list of TableInfos.
 */
protected void create(List<TableInfo> tableInfos){
  for (  TableInfo tableInfo : tableInfos) {
    DBObject options=setCollectionProperties(tableInfo);
    getDBName();
    DB db=mongo.getDB(databaseName);
    if (db.collectionExists(tableInfo.getTableName())) {
      db.getCollection(tableInfo.getTableName()).drop();
    }
    DBCollection collection=db.createCollection(tableInfo.getTableName(),options);
    boolean isCappedCollection=isCappedCollection(tableInfo);
    if (!isCappedCollection) {
      createIndexes(tableInfo,collection);
    }
  }
}
Program: 176525
Project: 176525
Buggy source:
/** 
 * Compute entity via super columns.
 * @param m the m
 * @param isRelation the is relation
 * @param relations the relations
 * @param entities the entities
 * @param qResults the q results
 */
protected void computeEntityViaSuperColumns(EntityMetadata m,boolean isRelation,List<String> relations,List<Object> entities,Map<Bytes,List<SuperColumn>> qResults){
  for (  Bytes key : qResults.keySet()) {
    List<SuperColumn> superColumns=qResults.get(key);
    ThriftRow tr=new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key.toByteArray()),m.getTableName(),new ArrayList<Column>(0),superColumns,new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
    Object o=getDataHandler().populateEntity(tr,m,relations,isRelation,isCql3Enabled(m));
    if (o != null) {
      entities.add(o);
    }
  }
}

Fixed version (ground truth):
/** 
 * Compute entity via super columns.
 * @param m the m
 * @param isRelation the is relation
 * @param relations the relations
 * @param entities the entities
 * @param qResults the q results
 */
protected void computeEntityViaSuperColumns(EntityMetadata m,boolean isRelation,List<String> relations,List<Object> entities,Map<Bytes,List<SuperColumn>> qResults){
  for (  Bytes key : qResults.keySet()) {
    List<SuperColumn> superColumns=qResults.get(key);
    ThriftRow tr=new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key.toByteArray()),m.getTableName(),new ArrayList<Column>(0),superColumns,new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
    Object o=getDataHandler().populateEntity(tr,m,relations,isRelation);
    if (o != null) {
      entities.add(o);
    }
  }
}
Program: 176526
Project: 176526
Buggy source:
/** 
 * Returns true in case of, composite Id and if cql3 opted and not a embedded entity.
 * @param metadata
 * @param metaModel
 * @return
 */
public boolean isCql3Enabled(){
  return isCql3Enabled(null);
}

Fixed version (ground truth):
/** 
 * Returns true in case of, composite Id and if cql3 opted and not a embedded entity.
 * @param metadata
 * @param metaModel
 * @return
 */
private boolean isCql3Enabled(){
  return isCql3Enabled(null);
}
Program: 176528
Project: 176528
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);
  try {
    if (isCql3Enabled()) {
      return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
    }
    return conn.execute_cql_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE);
  }
  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=getConection(persistenceUnit);
  conn=getConnection(pooledConnection);
  try {
    if (isCql3Enabled()) {
      return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
    }
    return conn.execute_cql_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE);
  }
  finally {
    releaseConnection(pooledConnection);
  }
}
Program: 176530
Project: 176530
Buggy source:
/** 
 * Deletes record for given primary key from counter column family.
 * @param pKey the key
 * @param metadata the metadata
 * @param consistencyLevel the consistency level
 */
protected void deleteRecordFromCounterColumnFamily(Object pKey,EntityMetadata metadata,ConsistencyLevel consistencyLevel){
  ColumnPath path=new ColumnPath(metadata.getTableName());
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  try {
    pooledConnection=getPooledConection(metadata.getPersistenceUnit());
    conn=getConnection(pooledConnection);
    conn.remove_counter((CassandraUtilities.toBytes(pKey,metadata.getIdAttribute().getJavaType())).getBytes(),path,consistencyLevel);
  }
 catch (  InvalidRequestException ire) {
    log.error("String_Node_Str" + ire);
    throw new PersistenceException(ire);
  }
catch (  UnavailableException ue) {
    log.error("String_Node_Str" + ue);
    throw new PersistenceException(ue);
  }
catch (  TimedOutException toe) {
    log.error("String_Node_Str" + toe);
    throw new PersistenceException(toe);
  }
catch (  TException te) {
    log.error("String_Node_Str" + te);
    throw new PersistenceException(te);
  }
 finally {
    releaseConnection(pooledConnection);
  }
}

Fixed version (ground truth):
/** 
 * Deletes record for given primary key from counter column family.
 * @param pKey the key
 * @param metadata the metadata
 * @param consistencyLevel the consistency level
 */
protected void deleteRecordFromCounterColumnFamily(Object pKey,EntityMetadata metadata,ConsistencyLevel consistencyLevel){
  ColumnPath path=new ColumnPath(metadata.getTableName());
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  try {
    pooledConnection=getConection(metadata.getPersistenceUnit());
    conn=getConnection(pooledConnection);
    conn.remove_counter((CassandraUtilities.toBytes(pKey,metadata.getIdAttribute().getJavaType())).getBytes(),path,consistencyLevel);
  }
 catch (  InvalidRequestException ire) {
    log.error("String_Node_Str" + ire);
    throw new PersistenceException(ire);
  }
catch (  UnavailableException ue) {
    log.error("String_Node_Str" + ue);
    throw new PersistenceException(ue);
  }
catch (  TimedOutException toe) {
    log.error("String_Node_Str" + toe);
    throw new PersistenceException(toe);
  }
catch (  TException te) {
    log.error("String_Node_Str" + te);
    throw new PersistenceException(te);
  }
 finally {
    releaseConnection(pooledConnection);
  }
}
Program: 176531
Project: 176531
Buggy source:
/** 
 * Returns raw cassandra client from thrift connection pool.
 * @param persistenceUnit persistence unit.
 * @param schema schema or keyspace.
 * @return raw cassandra client.
 */
protected Cassandra.Client getRawClient(final String persistenceUnit,final String schema){
  Cassandra.Client client=null;
  Object pooledConnection;
  pooledConnection=getPooledConection(persistenceUnit);
  client=getConnection(pooledConnection);
  try {
    client.set_cql_version(getCqlVersion());
  }
 catch (  InvalidRequestException irex) {
    log.error("String_Node_Str" + irex);
    throw new KunderaException(irex);
  }
catch (  TException tex) {
    log.error("String_Node_Str" + tex);
    throw new KunderaException(tex);
  }
 finally {
    releaseConnection(pooledConnection);
  }
  return client;
}

Fixed version (ground truth):
/** 
 * Returns raw cassandra client from thrift connection pool.
 * @param persistenceUnit persistence unit.
 * @param schema schema or keyspace.
 * @return raw cassandra client.
 */
protected Cassandra.Client getRawClient(final String persistenceUnit,final String schema){
  Cassandra.Client client=null;
  Object pooledConnection;
  pooledConnection=getConection(persistenceUnit);
  client=getConnection(pooledConnection);
  try {
    client.set_cql_version(getCqlVersion());
  }
 catch (  InvalidRequestException irex) {
    log.error("String_Node_Str" + irex);
    throw new KunderaException(irex);
  }
catch (  TException tex) {
    log.error("String_Node_Str" + tex);
    throw new KunderaException(tex);
  }
 finally {
    releaseConnection(pooledConnection);
  }
  return client;
}
Program: 176532
Project: 176532
Buggy source:
/** 
 * Compute entity via columns.
 * @param m the m
 * @param isRelation the is relation
 * @param relations the relations
 * @param entities the entities
 * @param qResults the q results
 */
protected void computeEntityViaColumns(EntityMetadata m,boolean isRelation,List<String> relations,List<Object> entities,Map<Bytes,List<Column>> qResults){
  for (  Bytes key : qResults.keySet()) {
    List<Column> columns=qResults.get(key);
    ThriftRow tr=new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key.toByteArray()),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
    Object o=getDataHandler().populateEntity(tr,m,relations,isRelation,isCql3Enabled(m));
    if (o != null) {
      entities.add(o);
    }
  }
}

Fixed version (ground truth):
/** 
 * Compute entity via columns.
 * @param m the m
 * @param isRelation the is relation
 * @param relations the relations
 * @param entities the entities
 * @param qResults the q results
 */
protected void computeEntityViaColumns(EntityMetadata m,boolean isRelation,List<String> relations,List<Object> entities,Map<Bytes,List<Column>> qResults){
  for (  Bytes key : qResults.keySet()) {
    List<Column> columns=qResults.get(key);
    ThriftRow tr=new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key.toByteArray()),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0));
    Object o=getDataHandler().populateEntity(tr,m,relations,isRelation);
    if (o != null) {
      entities.add(o);
    }
  }
}
Program: 176534
Project: 176534
Buggy source:
/** 
 * Populate entities from key slices.
 * @param m the m
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param keys the keys
 * @param dataHandler the data handler
 * @return the list
 * @throws Exception the exception
 */
protected List populateEntitiesFromKeySlices(EntityMetadata m,boolean isWrapReq,List<String> relations,List<KeySlice> keys,CassandraDataHandler dataHandler) throws Exception {
  List results;
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  Set<String> superColumnAttribs=metaModel.getEmbeddables(m.getEntityClazz()).keySet();
  results=new ArrayList(keys.size());
  ThriftDataResultHelper dataGenerator=new ThriftDataResultHelper();
  for (  KeySlice key : keys) {
    List<ColumnOrSuperColumn> columns=key.getColumns();
    byte[] rowKey=key.getKey();
    Object id=PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),rowKey);
    Map<ByteBuffer,List<ColumnOrSuperColumn>> data=new HashMap<ByteBuffer,List<ColumnOrSuperColumn>>(1);
    data.put(ByteBuffer.wrap(rowKey),columns);
    ThriftRow tr=new ThriftRow();
    tr.setId(id);
    tr.setColumnFamilyName(m.getTableName());
    tr=dataGenerator.translateToThriftRow(data,m.isCounterColumnType(),m.getType(),tr);
    results.add(dataHandler.populateEntity(tr,m,relations,isWrapReq,isCql3Enabled(m)));
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Populate entities from key slices.
 * @param m the m
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param keys the keys
 * @param dataHandler the data handler
 * @return the list
 * @throws Exception the exception
 */
protected List populateEntitiesFromKeySlices(EntityMetadata m,boolean isWrapReq,List<String> relations,List<KeySlice> keys,CassandraDataHandler dataHandler) throws Exception {
  List results;
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  Set<String> superColumnAttribs=metaModel.getEmbeddables(m.getEntityClazz()).keySet();
  results=new ArrayList(keys.size());
  ThriftDataResultHelper dataGenerator=new ThriftDataResultHelper();
  for (  KeySlice key : keys) {
    List<ColumnOrSuperColumn> columns=key.getColumns();
    byte[] rowKey=key.getKey();
    Object id=PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),rowKey);
    Map<ByteBuffer,List<ColumnOrSuperColumn>> data=new HashMap<ByteBuffer,List<ColumnOrSuperColumn>>(1);
    data.put(ByteBuffer.wrap(rowKey),columns);
    ThriftRow tr=new ThriftRow();
    tr.setId(id);
    tr.setColumnFamilyName(m.getTableName());
    tr=dataGenerator.translateToThriftRow(data,m.isCounterColumnType(),m.getType(),tr);
    results.add(dataHandler.populateEntity(tr,m,relations,isWrapReq));
  }
  return results;
}
Program: 176536
Project: 176536
Buggy source:
/** 
 * From thrift row.
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param consistencyLevel the consistency level
 * @return the object
 * @throws Exception the exception
 */
Object fromThriftRow(Class<?> clazz,EntityMetadata m,Object rowKey,List<String> relationNames,boolean isWrapReq,ConsistencyLevel consistencyLevel,boolean isCql3Enabled,Object conn) throws Exception ;

Fixed version (ground truth):
/** 
 * From thrift row.
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param consistencyLevel the consistency level
 * @return the object
 * @throws Exception the exception
 */
Object fromThriftRow(Class<?> clazz,EntityMetadata m,Object rowKey,List<String> relationNames,boolean isWrapReq,ConsistencyLevel consistencyLevel) throws Exception ;
Program: 176537
Project: 176537
Buggy source:
/** 
 * Populate entity.
 * @param tr the tr
 * @param m the m
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @return the object
 */
Object populateEntity(ThriftRow tr,EntityMetadata m,List<String> relationNames,boolean isWrapReq,boolean isCql3Enabled);

Fixed version (ground truth):
/** 
 * Populate entity.
 * @param tr the tr
 * @param m the m
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @return the object
 */
Object populateEntity(ThriftRow tr,EntityMetadata m,List<String> relationNames,boolean isWrapReq);
Program: 176540
Project: 176540
Buggy source:
@Override public ClassLoader getClassLoader(){
  return Thread.currentThread().getContextClassLoader();
}

Fixed version (ground truth):
@Override public ClassLoader getClassLoader(){
  return this.getClass().getClassLoader();
}
Program: 176541
Project: 176541
Buggy source:
/** 
 * Loads class with className using classLoader.
 * @param className the class name
 * @param classLoader the class loader
 * @return the class
 */
public static Class<?> classForName(String className,ClassLoader classLoader){
  try {
    Class<?> c=null;
    try {
      c=Class.forName(className,true,Thread.currentThread().getContextClassLoader());
    }
 catch (    ClassNotFoundException e) {
      try {
        c=Class.forName(className);
      }
 catch (      ClassNotFoundException e1) {
        if (classLoader == null) {
          throw e1;
        }
 else {
          c=classLoader.loadClass(className);
        }
      }
    }
    return c;
  }
 catch (  ClassNotFoundException e) {
    throw new KunderaException(e);
  }
}

Fixed version (ground truth):
/** 
 * Loads class with className using classLoader.
 * @param className the class name
 * @param classLoader the class loader
 * @return the class
 */
public static Class<?> classForName(String className,ClassLoader classLoader){
  try {
    Class<?> c=null;
    try {
      c=Class.forName(className,true,ReflectUtils.class.getClassLoader());
    }
 catch (    ClassNotFoundException e) {
      try {
        c=Class.forName(className);
      }
 catch (      ClassNotFoundException e1) {
        if (classLoader == null) {
          throw e1;
        }
 else {
          c=classLoader.loadClass(className);
        }
      }
    }
    return c;
  }
 catch (  ClassNotFoundException e) {
    throw new KunderaException(e);
  }
}
Program: 176542
Project: 176542
Buggy source:
@BeforeClass public static void setUp() throws Exception {
  Enumeration<URL> xmls=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
  while (xmls.hasMoreElements()) {
    metadatas=PersistenceXMLLoader.findPersistenceUnits(xmls.nextElement());
  }
}

Fixed version (ground truth):
@BeforeClass public static void setUp() throws Exception {
  Enumeration<URL> xmls=PersistenceUnitMetadata.class.getClassLoader().getResources("String_Node_Str");
  while (xmls.hasMoreElements()) {
    metadatas=PersistenceXMLLoader.findPersistenceUnits(xmls.nextElement());
  }
}
Program: 176543
Project: 176543
Buggy source:
/** 
 * Test method on persistence unit loading.
 */
@Test public void testLoadPersistenceUnitLoading(){
  try {
    Enumeration<URL> xmls=Thread.currentThread().getContextClassLoader().getResources("String_Node_Str");
    while (xmls.hasMoreElements()) {
      final String _pattern="String_Node_Str";
      List<PersistenceUnitMetadata> metadatas=PersistenceXMLLoader.findPersistenceUnits(xmls.nextElement());
      Assert.assertNotNull(metadatas);
      Assert.assertEquals(4,metadatas.size());
      Assert.assertEquals(50,metadatas.get(0).getClasses().size());
      Assert.assertNotNull(metadatas.get(0).getPersistenceUnitRootUrl());
      Assert.assertTrue(metadatas.get(0).getPersistenceUnitRootUrl().getPath().endsWith(_pattern));
    }
  }
 catch (  IOException ioex) {
    log.error(ioex.getMessage());
    Assert.fail();
  }
catch (  Exception e) {
    log.error(e.getMessage());
    Assert.fail();
  }
}

Fixed version (ground truth):
/** 
 * Test method on persistence unit loading.
 */
@Test public void testLoadPersistenceUnitLoading(){
  try {
    Enumeration<URL> xmls=this.getClass().getClassLoader().getResources("String_Node_Str");
    while (xmls.hasMoreElements()) {
      final String _pattern="String_Node_Str";
      List<PersistenceUnitMetadata> metadatas=PersistenceXMLLoader.findPersistenceUnits(xmls.nextElement());
      Assert.assertNotNull(metadatas);
      Assert.assertEquals(4,metadatas.size());
      Assert.assertEquals(50,metadatas.get(0).getClasses().size());
      Assert.assertNotNull(metadatas.get(0).getPersistenceUnitRootUrl());
      Assert.assertTrue(metadatas.get(0).getPersistenceUnitRootUrl().getPath().endsWith(_pattern));
    }
  }
 catch (  IOException ioex) {
    log.error(ioex.getMessage());
    Assert.fail();
  }
catch (  Exception e) {
    log.error(e.getMessage());
    Assert.fail();
  }
}
Program: 176544
Project: 176544
Buggy source:
/** 
 * Constructor parameterised with persistence units.
 * @param persistenceUnits persistence units.
 */
public ClientFactoryConfiguraton(Map puProperties,String... persistenceUnits){
  this.persistenceUnits=persistenceUnits;
  this.externalProperties=puProperties;
}

Fixed version (ground truth):
/** 
 * Constructor parameterised with persistence units.
 * @param persistenceUnits persistence units.
 */
public ClientFactoryConfiguraton(Map externalProperties,String... persistenceUnits){
  super(persistenceUnits,externalProperties);
}
Program: 176545
Project: 176545
Buggy source:
@Override public void configure(){
  for (  String pu : persistenceUnits) {
    log.info("String_Node_Str" + pu);
    Map<String,Object> puProperty=KunderaCoreUtils.getExternalProperties(pu,externalProperties,persistenceUnits);
    ClientResolver.getClientFactory(pu,puProperty).load(pu,puProperty);
  }
}

Fixed version (ground truth):
@Override public void configure(){
  for (  String pu : persistenceUnits) {
    log.info("String_Node_Str" + pu);
    Map<String,Object> puProperty=KunderaCoreUtils.getExternalProperties(pu,externalPropertyMap,persistenceUnits);
    ClientResolver.getClientFactory(pu,puProperty).load(pu,puProperty);
  }
}
Program: 176546
Project: 176546
Buggy source:
/** 
 * Configures and load meta-information for parameterised persistence units.
 */
void configure();

Fixed version (ground truth):
/** 
 * Configures and load meta-information for parameterized persistence units.
 */
void configure();
Program: 176547
Project: 176547
Buggy source:
/** 
 * Constructor using persistence units as parameter.
 * @param persistenceUnits persistence units.
 */
public MetamodelConfiguration(Map properties,String... persistenceUnits){
  this.persistenceUnits=persistenceUnits;
  this.externalProperyMap=properties;
}

Fixed version (ground truth):
/** 
 * Constructor using persistence units as parameter.
 * @param persistenceUnits persistence units.
 */
public MetamodelConfiguration(Map properties,String... persistenceUnits){
  super(persistenceUnits,properties);
}
Program: 176550
Project: 176550
Buggy source:
/** 
 * @param resources
 * @param reader
 * @throws IOException
 * @throws ClassNotFoundException
 */
private void validateEntityForClientSpecificProperty(List<Class<?>> classes,final String persistenceUnit){
  for (  Class clazz : classes) {
    String pu=getPersistenceUnitOfEntity(clazz);
    EntityValidator validator=new EntityValidatorImpl(KunderaCoreUtils.getExternalProperties(persistenceUnit,externalProperyMap,persistenceUnits));
    if (clazz.isAnnotationPresent(Entity.class) && clazz.isAnnotationPresent(Table.class) && persistenceUnit.equalsIgnoreCase(pu)) {
      validator.validateEntity(clazz);
    }
  }
}

Fixed version (ground truth):
/** 
 * @param resources
 * @param reader
 * @throws IOException
 * @throws ClassNotFoundException
 */
private void validateEntityForClientSpecificProperty(List<Class<?>> classes,final String persistenceUnit){
  for (  Class clazz : classes) {
    String pu=getPersistenceUnitOfEntity(clazz);
    EntityValidator validator=new EntityValidatorImpl(KunderaCoreUtils.getExternalProperties(persistenceUnit,externalPropertyMap,persistenceUnits));
    if (clazz.isAnnotationPresent(Entity.class) && clazz.isAnnotationPresent(Table.class) && persistenceUnit.equalsIgnoreCase(pu)) {
      validator.validateEntity(clazz);
    }
  }
}
Program: 176551
Project: 176551
Buggy source:
/** 
 * Constructor parameterised with persistence units.
 * @param persistenceUnits persistence units.
 */
public PersistenceUnitConfiguration(String... persistenceUnits){
  this.persistenceUnits=persistenceUnits;
}

Fixed version (ground truth):
/** 
 * Constructor parameterised with persistence units.
 * @param persistenceUnits persistence units.
 */
public PersistenceUnitConfiguration(String... persistenceUnits){
  super(persistenceUnits,null);
}
Program: 176552
Project: 176552
Buggy source:
/** 
 * Constructor using persistence units as parameter.
 * @param persistenceUnits persistence units.
 */
public SchemaConfiguration(Map externalProperties,String... persistenceUnits){
  this.persistenceUnits=persistenceUnits;
  this.externalPropertyMap=externalProperties;
}

Fixed version (ground truth):
/** 
 * Constructor using persistence units as parameter.
 * @param persistenceUnits persistence units.
 */
public SchemaConfiguration(Map externalProperties,String... persistenceUnits){
  super(persistenceUnits,externalProperties);
}
Program: 176554
Project: 176554
Buggy source:
private void testCountResult(){
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  ThriftClient tc=(ThriftClient)clientMap.get(SEC_IDX_CASSANDRA_TEST);
  tc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  CQLTranslator translator=new CQLTranslator();
  String query="String_Node_Str" + translator.ensureCase(new StringBuilder(),"String_Node_Str").toString();
  Query q=em.createNativeQuery(query,PersonCassandra.class);
  List noOfRows=q.getResultList();
  Assert.assertEquals(new Long(3),PropertyAccessorHelper.getObject(Long.class,((Column)noOfRows.get(0)).getValue()));
  Assert.assertEquals("String_Node_Str",PropertyAccessorHelper.getObject(String.class,((Column)noOfRows.get(0)).getName()));
}

Fixed version (ground truth):
private void testCountResult(){
  Map<String,Client> clientMap=(Map<String,Client>)em.getDelegate();
  ThriftClient tc=(ThriftClient)clientMap.get(SEC_IDX_CASSANDRA_TEST);
  tc.setCqlVersion(CassandraConstants.CQL_VERSION_3_0);
  CQLTranslator translator=new CQLTranslator();
  String query="String_Node_Str" + translator.ensureCase(new StringBuilder(),"String_Node_Str").toString();
  Query q=em.createNativeQuery(query,PersonCassandra.class);
  List noOfRows=q.getResultList();
  Assert.assertEquals(new Long(3),PropertyAccessorHelper.getObject(Long.class,((Column)noOfRows.get(0)).getValue()));
  Assert.assertEquals("String_Node_Str",PropertyAccessorHelper.getObject(String.class,((Column)noOfRows.get(0)).getName()));
  tc.setCqlVersion(CassandraConstants.CQL_VERSION_2_0);
}