nus-yam/ex-repair huggingface dataset:
Program: 176111
Project: 176111
Buggy source:
@Override public final void process(final Class<?> entityClass,EntityMetadata metadata){
  EntityListeners entityListeners=(EntityListeners)entityClass.getAnnotation(EntityListeners.class);
  if (entityListeners != null) {
    Class<?>[] entityListenerClasses=entityListeners.value();
    if (entityListenerClasses != null) {
      for (      Class<?> entityListener : entityListenerClasses) {
        try {
          entityListener.getConstructor();
        }
 catch (        NoSuchMethodException nsme) {
          throw new MetamodelLoaderException("String_Node_Str" + entityListener.getName() + "String_Node_Str");
        }
        for (        Method method : entityListener.getDeclaredMethods()) {
          List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityListener,method,1,entityClass);
          for (          Class<?> jpaAnnotation : jpaAnnotations) {
            CallbackMethod callBackMethod=new ExternalCallbackMethod(entityListener,method);
            addCallBackMethod(metadata,jpaAnnotation,callBackMethod);
          }
        }
      }
    }
  }
  for (  Method method : entityClass.getDeclaredMethods()) {
    List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityClass,method,0,entityClass);
    for (    Class<?> jpaAnnotation : jpaAnnotations) {
      CallbackMethod callbackMethod=new InternalCallbackMethod(metadata,method);
      addCallBackMethod(metadata,jpaAnnotation,callbackMethod);
    }
  }
}

Fixed version (ground truth):
@Override public final void process(final Class<?> entityClass,EntityMetadata metadata){
  EntityListeners entityListeners=(EntityListeners)entityClass.getAnnotation(EntityListeners.class);
  if (entityListeners != null) {
    Class<?>[] entityListenerClasses=entityListeners.value();
    if (entityListenerClasses != null) {
      for (      Class<?> entityListener : entityListenerClasses) {
        try {
          entityListener.getConstructor();
        }
 catch (        NoSuchMethodException nsme) {
          throw new MetamodelLoaderException("String_Node_Str" + entityListener.getName() + "String_Node_Str");
        }
        for (        Method method : entityListener.getDeclaredMethods()) {
          List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityListener,method,1,entityClass);
          for (          Class<?> jpaAnnotation : jpaAnnotations) {
            CallbackMethod callBackMethod=new ExternalCallbackMethod(entityListener,method);
            addCallBackMethod(metadata,jpaAnnotation,callBackMethod);
          }
        }
      }
    }
  }
  for (  Method method : entityClass.getMethods()) {
    List<Class<?>> jpaAnnotations=getValidJPAAnnotationsFromMethod(entityClass,method,0,entityClass);
    for (    Class<?> jpaAnnotation : jpaAnnotations) {
      CallbackMethod callbackMethod=new InternalCallbackMethod(metadata,method);
      addCallBackMethod(metadata,jpaAnnotation,callbackMethod);
    }
  }
}
Program: 176113
Project: 176113
Buggy source:
/** 
 * Creates the inverted index table.
 * @param tableInfo the table info
 * @throws InvalidRequestException the invalid request exception
 * @throws SchemaDisagreementException the schema disagreement exception
 * @throws TException the t exception
 */
private void createInvertedIndexTable(TableInfo tableInfo) throws InvalidRequestException, SchemaDisagreementException, TException {
  CfDef cfDef=getInvertedIndexCF(tableInfo);
  if (cfDef != null) {
    cassandra_client.system_add_column_family(cfDef);
  }
}

Fixed version (ground truth):
/** 
 * Creates the inverted index table.
 * @param tableInfo the table info
 * @throws Exception 
 */
private void createInvertedIndexTable(TableInfo tableInfo,KsDef ksDef) throws Exception {
  CfDef cfDef=getInvertedIndexCF(tableInfo);
  if (cfDef != null) {
    try {
      cassandra_client.system_add_column_family(cfDef);
    }
 catch (    InvalidRequestException irex) {
      updateExistingColumnFamily(tableInfo,ksDef,irex);
    }
  }
}
Program: 176114
Project: 176114
Buggy source:
/** 
 * @param tableInfos
 * @throws InvalidRequestException
 * @throws SchemaDisagreementException
 * @throws TException
 * @throws UnsupportedEncodingException
 * @throws NotFoundException
 * @throws UnavailableException
 * @throws TimedOutException
 */
private void createColumnFamilies(List<TableInfo> tableInfos,KsDef ksDef) throws Exception {
  for (  TableInfo tableInfo : tableInfos) {
    createOrUpdateColumnFamily(tableInfo,ksDef);
    createInvertedIndexTable(tableInfo);
  }
}

Fixed version (ground truth):
/** 
 * @param tableInfos
 * @throws InvalidRequestException
 * @throws SchemaDisagreementException
 * @throws TException
 * @throws UnsupportedEncodingException
 * @throws NotFoundException
 * @throws UnavailableException
 * @throws TimedOutException
 */
private void createColumnFamilies(List<TableInfo> tableInfos,KsDef ksDef) throws Exception {
  for (  TableInfo tableInfo : tableInfos) {
    createOrUpdateColumnFamily(tableInfo,ksDef);
    createInvertedIndexTable(tableInfo,ksDef);
  }
}
Program: 176115
Project: 176115
Buggy source:
/** 
 * Append range.
 * @param value the value
 * @param inclusive the inclusive
 * @param isGreaterThan the is greater than
 * @return the string
 */
private String appendRange(final String value,final boolean inclusive,final boolean isGreaterThan,final Class clazz){
  String appender="String_Node_Str";
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(inclusive ? "String_Node_Str" : "String_Node_Str");
  sb.append(isGreaterThan ? value : "String_Node_Str");
  sb.append(appender);
  sb.append("String_Node_Str");
  sb.append(appender);
  if (clazz != null && clazz.isAssignableFrom(int.class) || clazz.isAssignableFrom(Integer.class) || clazz.isAssignableFrom(short.class) || clazz.isAssignableFrom(long.class) || clazz.isAssignableFrom(Long.class) || clazz.isAssignableFrom(float.class) || clazz.isAssignableFrom(Float.class) || clazz.isAssignableFrom(BigDecimal.class) || clazz.isAssignableFrom(Double.class) || clazz.isAssignableFrom(double.class)) {
    sb.append(isGreaterThan ? "String_Node_Str" : value);
  }
 else {
    sb.append(isGreaterThan ? "String_Node_Str" : value);
  }
  sb.append(inclusive ? "String_Node_Str" : "String_Node_Str");
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Append range.
 * @param value the value
 * @param inclusive the inclusive
 * @param isGreaterThan the is greater than
 * @return the string
 */
private String appendRange(final String value,final boolean inclusive,final boolean isGreaterThan,final Class clazz){
  String appender="String_Node_Str";
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  sb.append(inclusive ? "String_Node_Str" : "String_Node_Str");
  sb.append(isGreaterThan ? value : "String_Node_Str");
  sb.append(appender);
  sb.append("String_Node_Str");
  sb.append(appender);
  if (clazz != null && (clazz.isAssignableFrom(int.class) || clazz.isAssignableFrom(Integer.class) || clazz.isAssignableFrom(short.class)|| clazz.isAssignableFrom(long.class)|| clazz.isAssignableFrom(Long.class)|| clazz.isAssignableFrom(float.class)|| clazz.isAssignableFrom(Float.class)|| clazz.isAssignableFrom(BigDecimal.class)|| clazz.isAssignableFrom(Double.class)|| clazz.isAssignableFrom(double.class))) {
    sb.append(isGreaterThan ? "String_Node_Str" : value);
  }
 else {
    sb.append(isGreaterThan ? "String_Node_Str" : value);
  }
  sb.append(inclusive ? "String_Node_Str" : "String_Node_Str");
  return sb.toString();
}
Program: 176116
Project: 176116
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,boolean isCql3Enabled){
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  pooledConnection=getConection();
  conn=getConnection(pooledConnection);
  try {
    if (isCql3Enabled || isCql3Enabled()) {
      return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
    }
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",cqlQuery);
    }
    return conn.execute_cql_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE);
  }
 catch (  Exception ex) {
    log.error("String_Node_Str",cqlQuery,ex);
    throw new PersistenceException(ex);
  }
 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,boolean isCql3Enabled){
  Cassandra.Client conn=null;
  Object pooledConnection=null;
  pooledConnection=getConection();
  conn=getConnection(pooledConnection);
  try {
    if (isCql3Enabled || isCql3Enabled()) {
      return conn.execute_cql3_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE,consistencyLevel);
    }
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",cqlQuery);
    }
    return conn.execute_cql_query(ByteBufferUtil.bytes(cqlQuery),org.apache.cassandra.thrift.Compression.NONE);
  }
 catch (  Exception ex) {
    if (log.isErrorEnabled()) {
      log.error("String_Node_Str",cqlQuery,ex);
    }
    throw new PersistenceException(ex);
  }
 finally {
    releaseConnection(pooledConnection);
  }
}
Program: 176118
Project: 176118
Buggy source:
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  if (em == null || !em.isOpen()) {
    em=emf.createEntityManager();
  }
  try {
    HBaseUser u=new HBaseUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    j++;
    if (j % 5000 == 0) {
      em.clear();
    }
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}

Fixed version (ground truth):
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  try {
    HBaseUser u=new HBaseUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    j++;
    if (j % 5000 == 0) {
      em.clear();
    }
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}
Program: 176121
Project: 176121
Buggy source:
/** 
 * Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.
 */
public void init() throws DBException {
  if ((getProperties().getProperty("String_Node_Str") != null) && (getProperties().getProperty("String_Node_Str").compareTo("String_Node_Str") == 0)) {
    _debug=true;
  }
  _columnFamily=getProperties().getProperty("String_Node_Str");
  _table=getProperties().getProperty("String_Node_Str");
  if (_columnFamily == null) {
    System.err.println("String_Node_Str");
    throw new DBException("String_Node_Str");
  }
  _columnFamilyBytes=Bytes.toBytes(_columnFamily);
}

Fixed version (ground truth):
/** 
 * Initialize any state for this DB. Called once per DB instance; there is one DB instance per client thread.
 */
public void init() throws DBException {
}
Program: 176122
Project: 176122
Buggy source:
/** 
 * Read a record from the database. Each field/value pair from the result will be stored in a HashMap.
 * @param table The name of the table
 * @param key The record key of the record to read.
 * @param fields The list of fields to read, or null for all of them
 * @param result A HashMap of field/value pairs for the result
 * @return Zero on success, a non-zero error code on error
 */
public int read(String table,String key,Set<String> fields,HashMap<String,ByteIterator> result){
  try {
    client.set_keyspace(_table);
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
  try {
    SlicePredicate predicate;
    if (fields == null) {
      predicate=new SlicePredicate().setSlice_range(new SliceRange(emptyByteBuffer,emptyByteBuffer,false,1000000));
    }
 else {
      ArrayList<ByteBuffer> fieldlist=new ArrayList<ByteBuffer>(fields.size());
      for (      String s : fields) {
        fieldlist.add(ByteBuffer.wrap(s.getBytes("String_Node_Str")));
      }
      predicate=new SlicePredicate().setColumn_names(fieldlist);
    }
    List<ColumnOrSuperColumn> results=client.get_slice(ByteBuffer.wrap(key.getBytes("String_Node_Str")),parent,predicate,readConsistencyLevel);
    if (_debug) {
      System.out.print("String_Node_Str" + key);
    }
    Column column;
    String name;
    ByteIterator value;
    for (    ColumnOrSuperColumn oneresult : results) {
      column=oneresult.column;
      name=new String(column.name.array(),column.name.position() + column.name.arrayOffset(),column.name.remaining());
      value=new ByteArrayByteIterator(column.value.array(),column.value.position() + column.value.arrayOffset(),column.value.remaining());
      result.put(name,value);
      if (_debug) {
        logger.info("String_Node_Str" + name + "String_Node_Str"+ value+ "String_Node_Str");
      }
    }
    if (_debug) {
      logger.info("String_Node_Str" + readConsistencyLevel.toString());
    }
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}

Fixed version (ground truth):
/** 
 * Read a record from the database. Each field/value pair from the result will be stored in a HashMap.
 * @param table The name of the table
 * @param key The record key of the record to read.
 * @param fields The list of fields to read, or null for all of them
 * @param result A HashMap of field/value pairs for the result
 * @return Zero on success, a non-zero error code on error
 */
public int read(String table,String key,Set<String> fields,HashMap<String,ByteIterator> result){
}
Program: 176123
Project: 176123
Buggy source:
/** 
 * On delete.
 * @param log the log
 */
private void onDelete(EventLog log){
  if (deleteEvents == null) {
    deleteEvents=new HashMap<Object,EventLog>();
    ;
  }
  deleteEvents.put(log.getEntityId(),log);
}

Fixed version (ground truth):
/** 
 * On delete.
 * @param log the log
 */
private void onDelete(EventLog log){
  if (deleteEvents == null) {
    deleteEvents=new ConcurrentHashMap<Object,EventLog>();
  }
  deleteEvents.put(log.getEntityId(),log);
}
Program: 176124
Project: 176124
Buggy source:
/** 
 * On update.
 * @param log the log
 */
private void onUpdate(EventLog log){
  if (updateEvents == null) {
    updateEvents=new HashMap<Object,EventLog>();
  }
  updateEvents.put(log.getEntityId(),log);
}

Fixed version (ground truth):
/** 
 * On update.
 * @param log the log
 */
private void onUpdate(EventLog log){
  if (updateEvents == null) {
    updateEvents=new ConcurrentHashMap<Object,EventLog>();
  }
  updateEvents.put(log.getEntityId(),log);
}
Program: 176125
Project: 176125
Buggy source:
/** 
 * On insert.
 * @param log the log
 */
private void onInsert(EventLog log){
  if (insertEvents == null) {
    insertEvents=new HashMap<Object,EventLog>();
  }
  insertEvents.put(log.getEntityId(),log);
}

Fixed version (ground truth):
/** 
 * On insert.
 * @param log the log
 */
private void onInsert(EventLog log){
  if (insertEvents == null) {
    insertEvents=new ConcurrentHashMap<Object,EventLog>();
  }
  insertEvents.put(log.getEntityId(),log);
}
Program: 176126
Project: 176126
Buggy source:
/** 
 * Instantiates a new flush manager.
 */
public FlushManager(){
  stackQueue=new ArrayDeque<Node>();
}

Fixed version (ground truth):
/** 
 * Instantiates a new flush manager.
 */
public FlushManager(){
  stackQueue=new LinkedBlockingDeque<Node>();
}
Program: 176127
Project: 176127
Buggy source:
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  try {
    PelopsUser u=new PelopsUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    j++;
    if (j % 5000 == 0) {
      em.clear();
    }
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}

Fixed version (ground truth):
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  try {
    PelopsUser u=new PelopsUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    em.clear();
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}
Program: 176128
Project: 176128
Buggy source:
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  if (em == null || !em.isOpen()) {
    em=emf.createEntityManager();
  }
  try {
    ThriftUser u=new ThriftUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    j++;
    if (j % 5000 == 0) {
      em.clear();
    }
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}

Fixed version (ground truth):
/** 
 * Insert a record in the database. Any field/value pairs in the specified values HashMap will be written into the record with the specified record key.
 * @param table The name of the table
 * @param key The record key of the record to insert.
 * @param values A HashMap of field/value pairs to insert in the record
 * @return Zero on success, a non-zero error code on error
 */
public int insert(String table,String key,HashMap<String,ByteIterator> values){
  if (em == null || !em.isOpen()) {
    em=emf.createEntityManager();
  }
  try {
    ThriftUser u=new ThriftUser(key,getString(key,"String_Node_Str"),getString(key,"String_Node_Str"),getString(key,"String_Node_Str"));
    em.persist(u);
    em.clear();
    return Ok;
  }
 catch (  Exception e) {
    logger.error(e);
    return Error;
  }
}
Program: 176130
Project: 176130
Buggy source:
/** 
 * Executes Select CQL Query.
 * @param cqlQuery the cql query
 * @param clazz the clazz
 * @param relationalField the relational field
 * @param dataHandler the data handler
 * @return the list
 */
public List executeSelectQuery(String cqlQuery,Class clazz,List<String> relationalField,CassandraDataHandler dataHandler){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str",cqlQuery);
  }
  return cqlClient.executeQuery(cqlQuery,clazz,relationalField,dataHandler,true);
}

Fixed version (ground truth):
/** 
 * Executes Select CQL Query.
 * @param cqlQuery the cql query
 * @param clazz the clazz
 * @param relationalField the relational field
 * @param dataHandler the data handler
 * @return the list
 */
public List executeSelectQuery(String cqlQuery,Class clazz,List<String> relationalField,CassandraDataHandler dataHandler,boolean isNative){
  if (log.isInfoEnabled()) {
    log.info("String_Node_Str",cqlQuery);
  }
  List entities=new ArrayList<Object>();
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(clazz);
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(entityMetadata.getPersistenceUnit());
  EntityType entityType=metaModel.entity(entityMetadata.getEntityClazz());
  List<AbstractManagedType> subManagedType=((AbstractManagedType)entityType).getSubManagedType();
  if (subManagedType.isEmpty()) {
    entities.addAll(cqlClient.executeQuery(cqlQuery,clazz,relationalField,dataHandler,true,isNative));
  }
 else {
    for (    AbstractManagedType subEntity : subManagedType) {
      EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(subEntity.getJavaType());
      entities.addAll(cqlClient.executeQuery(cqlQuery,subEntityMetadata.getEntityClazz(),relationalField,dataHandler,true,isNative));
    }
  }
  return entities;
}
Program: 176131
Project: 176131
Buggy source:
/** 
 * Finds entity on the basis of rowid and return list of objects.
 * @param metaModel
 * @param metadata
 * @param rowId
 * @param relationNames
 * @return
 */
public List<Object> find(MetamodelImpl metaModel,EntityMetadata metadata,Object rowId,List<String> relationNames){
  CQLTranslator translator=new CQLTranslator();
  String select_Query=translator.SELECTALL_QUERY;
  select_Query=StringUtils.replace(select_Query,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),metadata.getTableName(),false).toString());
  StringBuilder builder=new StringBuilder(select_Query);
  onWhereClause(metadata,rowId,translator,builder,metaModel);
  return CassandraClientBase.this.executeQuery(builder.toString(),metadata.getEntityClazz(),relationNames);
}

Fixed version (ground truth):
/** 
 * Finds entity on the basis of rowid and return list of objects.
 * @param metaModel
 * @param metadata
 * @param rowId
 * @param relationNames
 * @return
 */
public List<Object> find(MetamodelImpl metaModel,EntityMetadata metadata,Object rowId,List<String> relationNames){
  CQLTranslator translator=new CQLTranslator();
  String select_Query=translator.SELECTALL_QUERY;
  select_Query=StringUtils.replace(select_Query,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),metadata.getTableName(),false).toString());
  StringBuilder builder=new StringBuilder(select_Query);
  onWhereClause(metadata,rowId,translator,builder,metaModel);
  return CassandraClientBase.this.executeQuery(builder.toString(),metadata.getEntityClazz(),relationNames,false);
}
Program: 176132
Project: 176132
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){
  CQLTranslator translator=new CQLTranslator();
  String selectQuery=translator.SELECTALL_QUERY;
  selectQuery=StringUtils.replace(selectQuery,CQLTranslator.COLUMN_FAMILY,translator.ensureCase(new StringBuilder(),m.getTableName(),false).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnValue.getClass(),columnName,columnValue,CQLTranslator.EQ_CLAUSE,false);
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  return executeQuery(selectQueryBuilder.toString(),clazz,m.getRelationNames(),dataHandler,true);
}

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(),false).toString());
  StringBuilder selectQueryBuilder=new StringBuilder(selectQuery);
  selectQueryBuilder.append(CQLTranslator.ADD_WHERE_CLAUSE);
  translator.buildWhereClause(selectQueryBuilder,columnValue.getClass(),columnName,columnValue,CQLTranslator.EQ_CLAUSE,false);
  selectQueryBuilder.delete(selectQueryBuilder.lastIndexOf(CQLTranslator.AND_CLAUSE),selectQueryBuilder.length());
  return executeQuery(selectQueryBuilder.toString(),clazz,m.getRelationNames(),dataHandler,true,false);
}
Program: 176134
Project: 176134
Buggy source:
@Override public void delete(Object entity,Object pKey){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  EntityMetadata metadata=KunderaMetadataManager.getEntityMetadata(entity.getClass());
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (isCql3Enabled(metadata)) {
    String deleteQuery=onDeleteQuery(metadata,metaModel,pKey);
    executeQuery(deleteQuery,metadata.getEntityClazz(),null);
  }
 else {
    if (metadata.isCounterColumnType()) {
      deleteRecordFromCounterColumnFamily(pKey,metadata,getConsistencyLevel());
    }
 else {
      RowDeletor rowDeletor=clientFactory.getRowDeletor(pool);
      rowDeletor.deleteRow(metadata.getTableName(),CassandraUtilities.toBytes(pKey,metadata.getIdAttribute().getJavaType()),getConsistencyLevel());
    }
  }
  getIndexManager().remove(metadata,entity,pKey.toString());
  Object conn=getConection();
  try {
    invertedIndexHandler.delete(entity,metadata,getConsistencyLevel());
  }
  finally {
    if (conn != null) {
      releaseConnection(conn);
    }
  }
}

Fixed version (ground truth):
@Override public void delete(Object entity,Object pKey){
  if (!isOpen()) {
    throw new PersistenceException("String_Node_Str");
  }
  EntityMetadata metadata=KunderaMetadataManager.getEntityMetadata(entity.getClass());
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());
  if (isCql3Enabled(metadata)) {
    String deleteQuery=onDeleteQuery(metadata,metaModel,pKey);
    executeQuery(deleteQuery,metadata.getEntityClazz(),null,false);
  }
 else {
    if (metadata.isCounterColumnType()) {
      deleteRecordFromCounterColumnFamily(pKey,metadata,getConsistencyLevel());
    }
 else {
      RowDeletor rowDeletor=clientFactory.getRowDeletor(pool);
      rowDeletor.deleteRow(metadata.getTableName(),CassandraUtilities.toBytes(pKey,metadata.getIdAttribute().getJavaType()),getConsistencyLevel());
    }
  }
  getIndexManager().remove(metadata,entity,pKey.toString());
  Object conn=getConection();
  try {
    invertedIndexHandler.delete(entity,metadata,getConsistencyLevel());
  }
  finally {
    if (conn != null) {
      releaseConnection(conn);
    }
  }
}
Program: 176135
Project: 176135
Buggy source:
@Override public List<Object> findByRelation(String colName,Object colValue,Class clazz){
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(clazz);
  List<Object> entities=null;
  if (isCql3Enabled(m)) {
    entities=findByRelationQuery(m,colName,colValue,clazz,dataHandler);
  }
 else {
    Selector selector=clientFactory.getSelector(pool);
    SlicePredicate slicePredicate=Selector.newColumnsPredicateAll(false,10000);
    IndexClause ix=Selector.newIndexClause(Bytes.EMPTY,10000,Selector.newIndexExpression(colName,IndexOperator.EQ,Bytes.fromByteArray(PropertyAccessorHelper.getBytes(colValue))));
    Map<Bytes,List<Column>> qResults;
    try {
      qResults=selector.getIndexedColumns(m.getTableName(),ix,slicePredicate,getConsistencyLevel());
    }
 catch (    PelopsException e) {
      log.warn("String_Node_Str",colName,clazz);
      return entities;
    }
    entities=new ArrayList<Object>(qResults.size());
    populateData(m,qResults,entities,false,m.getRelationNames(),dataHandler);
  }
  return entities;
}

Fixed version (ground truth):
@Override public List<Object> findByRelation(String colName,Object colValue,Class clazz){
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(clazz);
  List<Object> entities=null;
  if (isCql3Enabled(m)) {
    entities=findByRelationQuery(m,colName,colValue,clazz,dataHandler);
  }
 else {
    Selector selector=clientFactory.getSelector(pool);
    SlicePredicate slicePredicate=Selector.newColumnsPredicateAll(false,10000);
    IndexClause ix=Selector.newIndexClause(Bytes.EMPTY,10000,Selector.newIndexExpression(colName,IndexOperator.EQ,Bytes.fromByteArray(PropertyAccessorHelper.getBytes(colValue))));
    Map<Bytes,List<Column>> qResults;
    try {
      qResults=selector.getIndexedColumns(m.getTableName(),ix,slicePredicate,getConsistencyLevel());
    }
 catch (    PelopsException e) {
      log.warn("String_Node_Str",colName,clazz);
      return entities;
    }
    entities=new ArrayList<Object>(qResults.size());
    MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
    EntityType entityType=metaModel.entity(m.getEntityClazz());
    List<AbstractManagedType> subManagedType=((AbstractManagedType)entityType).getSubManagedType();
    if (subManagedType.isEmpty()) {
      entities=populateData(m,qResults,entities,false,m.getRelationNames(),dataHandler);
    }
 else {
      for (      AbstractManagedType subEntity : subManagedType) {
        EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(subEntity.getJavaType());
        entities=populateData(subEntityMetadata,qResults,entities,false,subEntityMetadata.getRelationNames(),dataHandler);
      }
    }
  }
  return entities;
}
Program: 176136
Project: 176136
Buggy source:
/** 
 * Method to execute cql query and return back entity/enhance entities.
 * @param cqlQuery cql query to be executed.
 * @param clazz entity class.
 * @param relationalField collection for relational fields.
 * @return list of objects.
 */
@Override public List executeQuery(String cqlQuery,Class clazz,List<String> relationalField){
  return super.executeSelectQuery(cqlQuery,clazz,relationalField,dataHandler);
}

Fixed version (ground truth):
/** 
 * Method to execute cql query and return back entity/enhance entities.
 * @param cqlQuery cql query to be executed.
 * @param clazz entity class.
 * @param relationalField collection for relational fields.
 * @return list of objects.
 */
@Override public List executeQuery(String cqlQuery,Class clazz,List<String> relationalField,boolean isNative){
  return super.executeSelectQuery(cqlQuery,clazz,relationalField,dataHandler,isNative);
}
Program: 176138
Project: 176138
Buggy source:
/** 
 * On executeUpdate.
 * @return zero
 */
@Override protected int onExecuteUpdate(){
  EntityMetadata m=getEntityMetadata();
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  String query=appMetadata.getQuery(getJPAQuery());
  boolean isNative=kunderaQuery.isNative();
  if (isNative) {
    ((CassandraClientBase)persistenceDelegeator.getClient(m)).executeQuery(query != null ? query : getJPAQuery(),m.getEntityClazz(),null);
  }
 else   if (kunderaQuery.isDeleteUpdate()) {
    if (!isQueryConvertibleToCQL(kunderaQuery)) {
      List result=getResultList();
      return result != null ? result.size() : 0;
    }
 else {
      query=null;
      if (kunderaQuery.isUpdateClause()) {
        query=createUpdateQuery(kunderaQuery);
      }
 else {
        query=createDeleteQuery(kunderaQuery);
      }
      return ((CassandraClientBase)persistenceDelegeator.getClient(m)).executeUpdateDeleteQuery(query);
    }
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * On executeUpdate.
 * @return zero
 */
@Override protected int onExecuteUpdate(){
  EntityMetadata m=getEntityMetadata();
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  String query=appMetadata.getQuery(getJPAQuery());
  boolean isNative=kunderaQuery.isNative();
  if (isNative) {
    ((CassandraClientBase)persistenceDelegeator.getClient(m)).executeQuery(query != null ? query : getJPAQuery(),m.getEntityClazz(),null,isNative);
  }
 else   if (kunderaQuery.isDeleteUpdate()) {
    if (!isQueryConvertibleToCQL(kunderaQuery)) {
      List result=getResultList();
      return result != null ? result.size() : 0;
    }
 else {
      query=null;
      if (kunderaQuery.isUpdateClause()) {
        query=createUpdateQuery(kunderaQuery);
      }
 else {
        query=createDeleteQuery(kunderaQuery);
      }
      return ((CassandraClientBase)persistenceDelegeator.getClient(m)).executeUpdateDeleteQuery(query);
    }
  }
  return 0;
}
Program: 176141
Project: 176141
Buggy source:
@Override public boolean hasSingleIdAttribute(){
  return !isIdClass && idAttribute != null;
}

Fixed version (ground truth):
@Override public boolean hasSingleIdAttribute(){
  return !isIdClass && getIdAttribute() != null;
}
Program: 176142
Project: 176142
Buggy source:
public SingularAttribute<? super X,?> getIdAttribute(){
  return idAttribute == null ? getSuperClazzType() != null ? ((AbstractIdentifiableType)getSuperClazzType()).getIdAttribute() : null : idAttribute;
}

Fixed version (ground truth):
public SingularAttribute<? super X,?> getIdAttribute(){
  idAttribute=idAttribute == null ? getSuperClazzType() != null ? ((AbstractIdentifiableType)getSuperClazzType()).getIdAttribute() : null : idAttribute;
  return idAttribute;
}
Program: 176143
Project: 176143
Buggy source:
@Override public Set<SingularAttribute<? super X,?>> getIdClassAttributes(){
  if (isIdClass) {
    return idClassAttributes;
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
@Override public Set<SingularAttribute<? super X,?>> getIdClassAttributes(){
  if (isIdClass) {
    return idClassAttributes;
  }
 else   if (getSuperClazzType() != null) {
    idClassAttributes=((AbstractIdentifiableType)getSuperClazzType()).getIdClassAttributes();
  }
  throw new IllegalArgumentException("String_Node_Str");
}
Program: 176144
Project: 176144
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);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",m.getEntityClazz(),tr.getId());
    }
    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){
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  List<AbstractManagedType> subManagedType=((AbstractManagedType)entityType).getSubManagedType();
  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=null;
    if (!subManagedType.isEmpty()) {
      for (      AbstractManagedType subEntity : subManagedType) {
        EntityMetadata subEntityMetadata=KunderaMetadataManager.getEntityMetadata(subEntity.getJavaType());
        o=getDataHandler().populateEntity(tr,subEntityMetadata,subEntityMetadata.getRelationNames(),isRelation);
        if (o != null) {
          break;
        }
      }
    }
 else {
      o=getDataHandler().populateEntity(tr,m,relations,isRelation);
    }
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",m.getEntityClazz(),tr.getId());
    }
    if (o != null) {
      entities.add(o);
    }
  }
}
Program: 176146
Project: 176146
Buggy source:
/** 
 * On column.
 * @param column the column
 * @param m the m
 * @param entity the entity
 * @param entityType the entity type
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param isCql3Enabled
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
private Object onColumn(Column column,EntityMetadata m,Object entity,EntityType entityType,List<String> relationNames,boolean isWrapReq,Map<String,Object> relations,boolean isCql3Enabled) throws InstantiationException, IllegalAccessException {
  String thriftColumnName=PropertyAccessorFactory.STRING.fromBytes(String.class,column.getName());
  byte[] thriftColumnValue=column.getValue();
  String discriminatorColumn=((AbstractManagedType)entityType).getDiscriminatorColumn();
  if (!thriftColumnName.equals(discriminatorColumn)) {
    if (m.isCounterColumnType()) {
      LongAccessor accessor=new LongAccessor();
      Long value=accessor.fromBytes(Long.class,column.getValue());
      return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,value.toString(),isCql3Enabled);
    }
    return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,thriftColumnValue,isCql3Enabled);
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * On column.
 * @param column the column
 * @param m the m
 * @param entity the entity
 * @param entityType the entity type
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param isCql3Enabled
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
private Object onColumn(Column column,EntityMetadata m,Object entity,EntityType entityType,List<String> relationNames,boolean isWrapReq,Map<String,Object> relations,boolean isCql3Enabled) throws InstantiationException, IllegalAccessException {
  String thriftColumnName=PropertyAccessorFactory.STRING.fromBytes(String.class,column.getName());
  byte[] thriftColumnValue=column.getValue();
  String discriminatorColumn=((AbstractManagedType)entityType).getDiscriminatorColumn();
  String discriminatorValue=((AbstractManagedType)entityType).getDiscriminatorValue();
  if (!thriftColumnName.equals(discriminatorColumn)) {
    if (m.isCounterColumnType()) {
      LongAccessor accessor=new LongAccessor();
      Long value=accessor.fromBytes(Long.class,column.getValue());
      return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,value.toString(),isCql3Enabled);
    }
    return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,thriftColumnValue,isCql3Enabled);
  }
 else   if (thriftColumnName.contains(discriminatorColumn) && !PropertyAccessorFactory.STRING.fromBytes(String.class,thriftColumnValue).equals(discriminatorValue)) {
    entity=null;
  }
  return entity;
}
Program: 176148
Project: 176148
Buggy source:
private void populateData(EntityMetadata m,List<KeySlice> keySlices,List<Object> entities,boolean isRelational,List<String> relationNames){
  try {
    if (m.getType().isSuperColumnFamilyMetadata()) {
      List<Object> rowKeys=ThriftDataResultHelper.getRowKeys(keySlices,m);
      Object[] rowIds=rowKeys.toArray();
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
 else {
      for (      KeySlice keySlice : keySlices) {
        byte[] key=keySlice.getKey();
        List<ColumnOrSuperColumn> coscList=keySlice.getColumns();
        List<Column> columns=ThriftDataResultHelper.transformThriftResult(coscList,ColumnFamilyType.COLUMN,null);
        Object e=dataHandler.populateEntity(new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational);
        if (e != null) {
          entities.add(e);
        }
      }
    }
  }
 catch (  Exception e) {
    log.error("String_Node_Str",m.getTableName(),e);
    throw new KunderaException(e);
  }
}

Fixed version (ground truth):
private void populateData(EntityMetadata m,List<KeySlice> keySlices,List<Object> entities,boolean isRelational,List<String> relationNames){
  try {
    if (m.getType().isSuperColumnFamilyMetadata()) {
      List<Object> rowKeys=ThriftDataResultHelper.getRowKeys(keySlices,m);
      Object[] rowIds=rowKeys.toArray();
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
 else {
      for (      KeySlice keySlice : keySlices) {
        byte[] key=keySlice.getKey();
        List<ColumnOrSuperColumn> coscList=keySlice.getColumns();
        List<Column> columns=ThriftDataResultHelper.transformThriftResult(coscList,ColumnFamilyType.COLUMN,null);
        Object e=dataHandler.populateEntity(new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational);
        if (e != null) {
          entities.add(e);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.error("String_Node_Str",m.getTableName(),e);
    throw new KunderaException(e);
  }
}
Program: 176150
Project: 176150
Buggy source:
/** 
 * On column.
 * @param column the column
 * @param m the m
 * @param entity the entity
 * @param entityType the entity type
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param isCql3Enabled
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
private Object onColumn(Column column,EntityMetadata m,Object entity,EntityType entityType,List<String> relationNames,boolean isWrapReq,Map<String,Object> relations,boolean isCql3Enabled) throws InstantiationException, IllegalAccessException {
  String thriftColumnName=PropertyAccessorFactory.STRING.fromBytes(String.class,column.getName());
  byte[] thriftColumnValue=column.getValue();
  String discriminatorColumn=((AbstractManagedType)entityType).getDiscriminatorColumn();
  String discriminatorValue=((AbstractManagedType)entityType).getDiscriminatorValue();
  if (!thriftColumnName.equals(discriminatorColumn)) {
    if (m.isCounterColumnType()) {
      LongAccessor accessor=new LongAccessor();
      Long value=accessor.fromBytes(Long.class,column.getValue());
      return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,value.toString(),isCql3Enabled);
    }
    return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,thriftColumnValue,isCql3Enabled);
  }
 else   if (thriftColumnName.contains(discriminatorColumn) && !PropertyAccessorFactory.STRING.fromBytes(String.class,thriftColumnValue).equals(discriminatorValue)) {
    entity=null;
  }
  return entity;
}

Fixed version (ground truth):
/** 
 * On column.
 * @param column the column
 * @param m the m
 * @param entity the entity
 * @param entityType the entity type
 * @param relationNames the relation names
 * @param isWrapReq the is wrap req
 * @param relations the relations
 * @param isCql3Enabled
 * @throws IllegalAccessException
 * @throws InstantiationException
 */
private Object onColumn(Column column,EntityMetadata m,Object entity,EntityType entityType,List<String> relationNames,boolean isWrapReq,Map<String,Object> relations,boolean isCql3Enabled) throws InstantiationException, IllegalAccessException {
  String thriftColumnName=PropertyAccessorFactory.STRING.fromBytes(String.class,column.getName());
  byte[] thriftColumnValue=column.getValue();
  String discriminatorColumn=((AbstractManagedType)entityType).getDiscriminatorColumn();
  String discriminatorValue=((AbstractManagedType)entityType).getDiscriminatorValue();
  if (!thriftColumnName.equals(discriminatorColumn)) {
    if (m.isCounterColumnType()) {
      LongAccessor accessor=new LongAccessor();
      Long value=accessor.fromBytes(Long.class,column.getValue());
      return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,value.toString(),isCql3Enabled);
    }
    return populateViaThrift(m,entity,entityType,relationNames,relations,thriftColumnName,thriftColumnValue,isCql3Enabled);
  }
  return entity;
}
Program: 176152
Project: 176152
Buggy source:
private void populateData(EntityMetadata m,List<KeySlice> keySlices,List<Object> entities,boolean isRelational,List<String> relationNames){
  try {
    if (m.getType().isSuperColumnFamilyMetadata()) {
      List<Object> rowKeys=ThriftDataResultHelper.getRowKeys(keySlices,m);
      Object[] rowIds=rowKeys.toArray();
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
 else {
      for (      KeySlice keySlice : keySlices) {
        byte[] key=keySlice.getKey();
        List<ColumnOrSuperColumn> coscList=keySlice.getColumns();
        List<Column> columns=ThriftDataResultHelper.transformThriftResult(coscList,ColumnFamilyType.COLUMN,null);
        Object e=dataHandler.populateEntity(new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational);
        if (e != null) {
          entities.add(e);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.error("String_Node_Str",m.getTableName(),e);
    throw new KunderaException(e);
  }
}

Fixed version (ground truth):
private List populateData(EntityMetadata m,List<KeySlice> keySlices,List<Object> entities,boolean isRelational,List<String> relationNames){
  try {
    if (m.getType().isSuperColumnFamilyMetadata()) {
      List<Object> rowKeys=ThriftDataResultHelper.getRowKeys(keySlices,m);
      Object[] rowIds=rowKeys.toArray();
      entities.addAll(findAll(m.getEntityClazz(),null,rowIds));
    }
 else {
      for (      KeySlice keySlice : keySlices) {
        byte[] key=keySlice.getKey();
        List<ColumnOrSuperColumn> coscList=keySlice.getColumns();
        List<Column> columns=ThriftDataResultHelper.transformThriftResult(coscList,ColumnFamilyType.COLUMN,null);
        Object e=dataHandler.populateEntity(new ThriftRow(PropertyAccessorHelper.getObject(m.getIdAttribute().getJavaType(),key),m.getTableName(),columns,new ArrayList<SuperColumn>(0),new ArrayList<CounterColumn>(0),new ArrayList<CounterSuperColumn>(0)),m,relationNames,isRelational);
        if (e != null) {
          entities.add(e);
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    log.error("String_Node_Str",m.getTableName(),e);
    throw new KunderaException(e);
  }
  return entities;
}