nus-yam/ex-repair huggingface dataset:
Program: 176341
Project: 176341
Buggy source:
/** 
 * @param tableInfo
 * @param collection
 */
private void createIndexes(TableInfo tableInfo,DBCollection collection){
  for (  IndexInfo indexInfo : tableInfo.getColumnsToBeIndexed()) {
    DBObject keys=new BasicDBObject();
    getIndexType(indexInfo.getIndexType(),keys,indexInfo.getColumnName());
    DBObject options=new BasicDBObject();
    if (indexInfo.getMinValue() != null) {
      options.put(MongoDBConstants.MIN,indexInfo.getMinValue());
    }
    if (indexInfo.getMaxValue() != null) {
      options.put(MongoDBConstants.MAX,indexInfo.getMaxValue());
    }
    collection.ensureIndex(keys,options);
  }
}

Fixed version (ground truth):
/** 
 * @param tableInfo
 * @param collection
 */
private void createIndexes(TableInfo tableInfo,DBCollection collection){
  for (  ColumnInfo columnInfo : tableInfo.getColumnMetadatas()) {
    if (columnInfo.isIndexable()) {
      IndexInfo indexInfo=tableInfo.getColumnToBeIndexed(columnInfo.getColumnName());
      indexColumn(indexInfo,collection);
    }
  }
  for (  EmbeddedColumnInfo info : tableInfo.getEmbeddedColumnMetadatas()) {
    for (    ColumnInfo columnInfo : info.getColumns()) {
      if (columnInfo.isIndexable()) {
        IndexInfo indexInfo=tableInfo.getColumnToBeIndexed(columnInfo.getColumnName());
        indexEmbeddedColumn(indexInfo,info.getEmbeddedColumnName(),collection);
      }
    }
  }
}
Program: 176342
Project: 176342
Buggy source:
/** 
 * On persist.
 * @param entityMetadata the entity metadata
 * @param entity the entity
 * @param id the id
 * @param relations the relations
 */
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> relations){
  String tableName=entityMetadata.getTableName();
  try {
    handler.writeData(tableName,entityMetadata,entity,id,relations);
  }
 catch (  IOException e) {
    throw new PersistenceException(e);
  }
}

Fixed version (ground truth):
/** 
 * On persist.
 * @param entityMetadata the entity metadata
 * @param entity the entity
 * @param id the id
 * @param relations the relations
 */
@Override protected void onPersist(EntityMetadata entityMetadata,Object entity,Object id,List<RelationHolder> relations){
  String tableName=entityMetadata.getSchema();
  try {
    handler.writeData(tableName,entityMetadata,entity,id,relations);
  }
 catch (  IOException e) {
    throw new PersistenceException(e);
  }
}
Program: 176343
Project: 176343
Buggy source:
@Override public <E>List<E> findAll(Class<E> entityClass,String[] columnsToSelect,Object... rowIds){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  if (rowIds == null) {
    return null;
  }
  List results;
  try {
    results=handler.readAll(entityMetadata.getTableName(),entityMetadata.getEntityClazz(),entityMetadata,Arrays.asList(rowIds),entityMetadata.getRelationNames());
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}

Fixed version (ground truth):
@Override public <E>List<E> findAll(Class<E> entityClass,String[] columnsToSelect,Object... rowIds){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  if (rowIds == null) {
    return null;
  }
  List results;
  try {
    results=handler.readAll(entityMetadata.getSchema(),entityMetadata.getEntityClazz(),entityMetadata,Arrays.asList(rowIds),entityMetadata.getRelationNames());
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}
Program: 176344
Project: 176344
Buggy source:
/** 
 * Handles find by range query for given start and end row key range values.
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata
 * @param startRow start row.
 * @param endRow end row.
 * @return collection holding results.
 */
public <E>List<E> findByRange(Class<E> entityClass,EntityMetadata metadata,byte[] startRow,byte[] endRow,String[] columns,Filter f){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  String tableName=entityMetadata.getTableName();
  List results=new ArrayList();
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readDataByRange(tableName,entityClass,metadata,startRow,endRow,columns,filter);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Handles find by range query for given start and end row key range values.
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata
 * @param startRow start row.
 * @param endRow end row.
 * @return collection holding results.
 */
public <E>List<E> findByRange(Class<E> entityClass,EntityMetadata metadata,byte[] startRow,byte[] endRow,String[] columns,Filter f){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  String tableName=entityMetadata.getSchema();
  List results=new ArrayList();
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readDataByRange(tableName,entityClass,metadata,startRow,endRow,columns,filter);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results;
}
Program: 176345
Project: 176345
Buggy source:
@Override public List<Object> findByRelation(String colName,Object colValue,Class entityClazz){
  CompareOp operator=HBaseUtils.getOperator("String_Node_Str",false);
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  String columnFamilyName=m.getTableName();
  byte[] valueInBytes=HBaseUtils.getBytes(colValue);
  SingleColumnValueFilter f=null;
  f=new SingleColumnValueFilter(Bytes.toBytes(columnFamilyName),Bytes.toBytes(colName),operator,valueInBytes);
  try {
    return ((HBaseDataHandler)handler).scanData(f,m.getTableName(),entityClazz,m,columnFamilyName,colName);
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",ioe);
    throw new KunderaException(ioe);
  }
catch (  InstantiationException ie) {
    log.error("String_Node_Str",ie);
    throw new KunderaException(ie);
  }
catch (  IllegalAccessException iae) {
    log.error("String_Node_Str",iae);
    throw new KunderaException(iae);
  }
}

Fixed version (ground truth):
@Override public List<Object> findByRelation(String colName,Object colValue,Class entityClazz){
  CompareOp operator=HBaseUtils.getOperator("String_Node_Str",false);
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  String columnFamilyName=m.getTableName();
  byte[] valueInBytes=HBaseUtils.getBytes(colValue);
  SingleColumnValueFilter f=null;
  f=new SingleColumnValueFilter(Bytes.toBytes(columnFamilyName),Bytes.toBytes(colName),operator,valueInBytes);
  try {
    return ((HBaseDataHandler)handler).scanData(f,m.getSchema(),entityClazz,m,columnFamilyName,colName);
  }
 catch (  IOException ioe) {
    log.error("String_Node_Str",ioe);
    throw new KunderaException(ioe);
  }
catch (  InstantiationException ie) {
    log.error("String_Node_Str",ie);
    throw new KunderaException(ie);
  }
catch (  IllegalAccessException iae) {
    log.error("String_Node_Str",iae);
    throw new KunderaException(iae);
  }
}
Program: 176346
Project: 176346
Buggy source:
@Override public Object[] findIdsByColumn(String schemaName,String tableName,String pKeyName,String columnName,Object columnValue,Class entityClazz){
  CompareOp operator=HBaseUtils.getOperator("String_Node_Str",false);
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  byte[] valueInBytes=HBaseUtils.getBytes(columnValue);
  Filter f=new SingleColumnValueFilter(Bytes.toBytes(tableName),Bytes.toBytes(columnName),operator,valueInBytes);
  KeyOnlyFilter keyFilter=new KeyOnlyFilter();
  FilterList filterList=new FilterList(f,keyFilter);
  try {
    return handler.scanRowyKeys(filterList,tableName,tableName,columnName + "String_Node_Str" + columnValue,m.getIdAttribute().getBindableJavaType());
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException(e);
  }
}

Fixed version (ground truth):
@Override public Object[] findIdsByColumn(String schemaName,String tableName,String pKeyName,String columnName,Object columnValue,Class entityClazz){
  CompareOp operator=HBaseUtils.getOperator("String_Node_Str",false);
  EntityMetadata m=KunderaMetadataManager.getEntityMetadata(entityClazz);
  byte[] valueInBytes=HBaseUtils.getBytes(columnValue);
  Filter f=new SingleColumnValueFilter(Bytes.toBytes(tableName),Bytes.toBytes(columnName),operator,valueInBytes);
  KeyOnlyFilter keyFilter=new KeyOnlyFilter();
  FilterList filterList=new FilterList(f,keyFilter);
  try {
    return handler.scanRowyKeys(filterList,schemaName,tableName,columnName + "String_Node_Str" + columnValue,m.getIdAttribute().getBindableJavaType());
  }
 catch (  IOException e) {
    log.error("String_Node_Str",e);
    throw new KunderaException(e);
  }
}
Program: 176347
Project: 176347
Buggy source:
public void deleteByColumn(String schemaName,String tableName,String columnName,Object columnValue){
  try {
    handler.deleteRow(columnValue,tableName);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new PersistenceException(ioex);
  }
}

Fixed version (ground truth):
public void deleteByColumn(String schemaName,String tableName,String columnName,Object columnValue){
  try {
    handler.deleteRow(columnValue,schemaName,tableName);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new PersistenceException(ioex);
  }
}
Program: 176348
Project: 176348
Buggy source:
@Override public <E>List<E> find(Class<E> entityClass,Map<String,String> col){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(getPersistenceUnit(),entityClass);
  List<E> entities=new ArrayList<E>();
  Map<String,Field> columnFamilyNameToFieldMap=MetadataUtils.createSuperColumnsFieldMap(entityMetadata);
  for (  String columnFamilyName : col.keySet()) {
    String entityId=col.get(columnFamilyName);
    if (entityId != null) {
      E e=null;
      try {
        List results=handler.readData(entityMetadata.getTableName(),entityMetadata.getEntityClazz(),entityMetadata,entityId,null,null);
        if (results != null) {
          e=(E)results.get(0);
        }
      }
 catch (      IOException ioex) {
        log.error("String_Node_Str",ioex);
        throw new KunderaException(ioex);
      }
      Field columnFamilyField=columnFamilyNameToFieldMap.get(columnFamilyName.substring(0,columnFamilyName.indexOf("String_Node_Str")));
      Object columnFamilyValue=PropertyAccessorHelper.getObject(e,columnFamilyField);
      if (Collection.class.isAssignableFrom(columnFamilyField.getType())) {
        entities.addAll((Collection)columnFamilyValue);
      }
 else {
        entities.add((E)columnFamilyValue);
      }
    }
  }
  return entities;
}

Fixed version (ground truth):
/** 
 * (non-Javadoc)
 * @see com.impetus.kundera.client.Client#find(java.lang.Class,java.util.Map)
 */
@Override public <E>List<E> find(Class<E> entityClass,Map<String,String> col){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(getPersistenceUnit(),entityClass);
  List<E> entities=new ArrayList<E>();
  Map<String,Field> columnFamilyNameToFieldMap=MetadataUtils.createSuperColumnsFieldMap(entityMetadata);
  for (  String columnFamilyName : col.keySet()) {
    String entityId=col.get(columnFamilyName);
    if (entityId != null) {
      E e=null;
      try {
        List results=handler.readData(entityMetadata.getSchema(),entityMetadata.getEntityClazz(),entityMetadata,entityId,null,null);
        if (results != null) {
          e=(E)results.get(0);
        }
      }
 catch (      IOException ioex) {
        log.error("String_Node_Str",ioex);
        throw new KunderaException(ioex);
      }
      Field columnFamilyField=columnFamilyNameToFieldMap.get(columnFamilyName.substring(0,columnFamilyName.indexOf("String_Node_Str")));
      Object columnFamilyValue=PropertyAccessorHelper.getObject(e,columnFamilyField);
      if (Collection.class.isAssignableFrom(columnFamilyField.getType())) {
        entities.addAll((Collection)columnFamilyValue);
      }
 else {
        entities.add((E)columnFamilyValue);
      }
    }
  }
  return entities;
}
Program: 176349
Project: 176349
Buggy source:
@Override public Long generate(TableGeneratorDiscriptor discriptor){
  try {
    HTableInterface hTable=((HBaseDataHandler)handler).gethTable(discriptor.getTable());
    Long latestCount=hTable.incrementColumnValue(discriptor.getPkColumnValue().getBytes(),discriptor.getTable().getBytes(),discriptor.getValueColumnName().getBytes(),1);
    if (latestCount == 1) {
      return (long)discriptor.getInitialValue();
    }
 else {
      return (latestCount - 1) * discriptor.getAllocationSize();
    }
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
}

Fixed version (ground truth):
@Override public Long generate(TableGeneratorDiscriptor discriptor){
  try {
    HTableInterface hTable=((HBaseDataHandler)handler).gethTable(discriptor.getSchema());
    Long latestCount=hTable.incrementColumnValue(discriptor.getPkColumnValue().getBytes(),discriptor.getTable().getBytes(),discriptor.getValueColumnName().getBytes(),1);
    if (latestCount == 1) {
      return (long)discriptor.getInitialValue();
    }
 else {
      return (latestCount - 1) * discriptor.getAllocationSize();
    }
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
}
Program: 176350
Project: 176350
Buggy source:
/** 
 * Method to find entities using JPQL(converted into FilterList.)
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata.
 * @return list of entities.
 */
public <E>List<E> findByQuery(Class<E> entityClass,EntityMetadata metadata,Filter f,String... columns){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  List<String> relationNames=entityMetadata.getRelationNames();
  String tableName=entityMetadata.getTableName();
  List results=null;
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,null,relationNames,filter,columns);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results != null ? results : new ArrayList();
}

Fixed version (ground truth):
/** 
 * Method to find entities using JPQL(converted into FilterList.)
 * @param < E > parameterized entity class.
 * @param entityClass entity class.
 * @param metadata entity metadata.
 * @return list of entities.
 */
public <E>List<E> findByQuery(Class<E> entityClass,EntityMetadata metadata,Filter f,String... columns){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(entityClass);
  List<String> relationNames=entityMetadata.getRelationNames();
  String tableName=entityMetadata.getSchema();
  List results=null;
  FilterList filter=new FilterList();
  if (f != null) {
    filter.addFilter(f);
  }
  if (isFindKeyOnly(metadata,columns)) {
    columns=null;
    filter.addFilter(new KeyOnlyFilter());
  }
  try {
    results=handler.readData(tableName,entityMetadata.getEntityClazz(),entityMetadata,null,relationNames,filter,columns);
  }
 catch (  IOException ioex) {
    log.error("String_Node_Str",ioex);
    throw new KunderaException(ioex);
  }
  return results != null ? results : new ArrayList();
}
Program: 176352
Project: 176352
Buggy source:
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  for (  Object key : joinTableRecords.keySet()) {
    Set<Object> values=joinTableRecords.get(key);
    Object joinColumnValue=key;
    Map<String,Object> columns=new HashMap<String,Object>();
    for (    Object childValue : values) {
      Object invJoinColumnValue=childValue;
      columns.put(invJoinColumnName + "String_Node_Str" + invJoinColumnValue,invJoinColumnValue);
    }
    if (columns != null && !columns.isEmpty()) {
      try {
        handler.createTableIfDoesNotExist(joinTableName,joinTableName);
        handler.writeJoinTableData(joinTableName,joinColumnValue,columns);
      }
 catch (      IOException e) {
        throw new PersistenceException(e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  for (  Object key : joinTableRecords.keySet()) {
    Set<Object> values=joinTableRecords.get(key);
    Object joinColumnValue=key;
    Map<String,Object> columns=new HashMap<String,Object>();
    for (    Object childValue : values) {
      Object invJoinColumnValue=childValue;
      columns.put(invJoinColumnName + "String_Node_Str" + invJoinColumnValue,invJoinColumnValue);
    }
    if (columns != null && !columns.isEmpty()) {
      try {
        handler.createTableIfDoesNotExist(joinTableName,joinTableName);
        handler.writeJoinTableData(joinTableName,joinColumnValue,columns,joinTableName);
      }
 catch (      IOException e) {
        throw new PersistenceException(e);
      }
    }
  }
}
Program: 176353
Project: 176353
Buggy source:
/** 
 * Writes columns data to HBase table, supplied as a map in Key/ value pair; key and value representing column name and value respectively.
 * @param htable the htable
 * @param rowKey the row key
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeColumns(HTableInterface htable,Object rowKey,Map<String,Object> columns) throws IOException ;

Fixed version (ground truth):
/** 
 * Writes columns data to HBase table, supplied as a map in Key/ value pair; key and value representing column name and value respectively.
 * @param htable the htable
 * @param rowKey the row key
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeColumns(HTableInterface htable,Object rowKey,Map<String,Object> columns,String columnFamilyName) throws IOException ;
Program: 176354
Project: 176354
Buggy source:
/** 
 * Write relations.
 * @param htable the htable
 * @param rowKey the row key
 * @param containsEmbeddedObjectsOnly the contains embedded objects only
 * @param relations the relations
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeRelations(HTableInterface htable,Object rowKey,boolean containsEmbeddedObjectsOnly,List<RelationHolder> relations) throws IOException ;

Fixed version (ground truth):
/** 
 * Write relations.
 * @param htable the htable
 * @param rowKey the row key
 * @param containsEmbeddedObjectsOnly the contains embedded objects only
 * @param relations the relations
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeRelations(HTableInterface htable,Object rowKey,boolean containsEmbeddedObjectsOnly,List<RelationHolder> relations,String columnFamilyName) throws IOException ;
Program: 176355
Project: 176355
Buggy source:
/** 
 * Delete specific row.
 * @param rowKey the row key
 * @param tableName the table name
 * @throws IOException Signals that an I/O exception has occurred.
 */
void deleteRow(Object rowKey,String tableName) throws IOException ;

Fixed version (ground truth):
/** 
 * Delete specific row.
 * @param rowKey the row key
 * @param tableName the table name
 * @throws IOException Signals that an I/O exception has occurred.
 */
void deleteRow(Object rowKey,String tableName,String columnFamilyName) throws IOException ;
Program: 176356
Project: 176356
Buggy source:
/** 
 * Populates data for give column family, column name, and HBase table name.
 * @param tableName the table name
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param f 
 * @param relationNames the relation names
 * @return the object
 * @throws IOException Signals that an I/O exception has occurred.
 */
List readData(String tableName,Class clazz,EntityMetadata m,Object rowKey,List<String> relatationNames,FilterList f,String... columns) throws IOException ;

Fixed version (ground truth):
/** 
 * Populates data for give column family, column name, and HBase table name.
 * @param tableName the table name
 * @param clazz the clazz
 * @param m the m
 * @param rowKey the row key
 * @param f
 * @param relationNames the relation names
 * @return the object
 * @throws IOException Signals that an I/O exception has occurred.
 */
List readData(String tableName,Class clazz,EntityMetadata m,Object rowKey,List<String> relatationNames,FilterList f,String... columns) throws IOException ;
Program: 176357
Project: 176357
Buggy source:
/** 
 * Writes data into Join Table.
 * @param tableName the table name
 * @param rowId the row id
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns) throws IOException ;

Fixed version (ground truth):
/** 
 * Writes data into Join Table.
 * @param tableName the table name
 * @param rowId the row id
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns,String joinTableName) throws IOException ;
Program: 176358
Project: 176358
Buggy source:
/** 
 * @param tableName
 * @param clazz
 * @param m
 * @param relationNames
 * @param startRow
 * @param endRow
 * @param columns
 * @param f 
 * @return
 */
List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns,FilterList f) throws IOException ;

Fixed version (ground truth):
/** 
 * @param tableName
 * @param clazz
 * @param m
 * @param relationNames
 * @param startRow
 * @param endRow
 * @param columns
 * @param f
 * @return
 */
List readDataByRange(String tableName,Class clazz,EntityMetadata m,byte[] startRow,byte[] endRow,String[] columns,FilterList f) throws IOException ;
Program: 176360
Project: 176360
Buggy source:
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  for (  Object key : joinTableRecords.keySet()) {
    Set<Object> values=joinTableRecords.get(key);
    Object joinColumnValue=key;
    Map<String,Object> columns=new HashMap<String,Object>();
    for (    Object childValue : values) {
      Object invJoinColumnValue=childValue;
      columns.put(invJoinColumnName + "String_Node_Str" + invJoinColumnValue,invJoinColumnValue);
    }
    if (columns != null && !columns.isEmpty()) {
      try {
        handler.createTableIfDoesNotExist(joinTableName,joinTableName);
        handler.writeJoinTableData(joinTableName,joinColumnValue,columns,joinTableName);
      }
 catch (      IOException e) {
        throw new PersistenceException(e);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void persistJoinTable(JoinTableData joinTableData){
  String joinTableName=joinTableData.getJoinTableName();
  String invJoinColumnName=joinTableData.getInverseJoinColumnName();
  Map<Object,Set<Object>> joinTableRecords=joinTableData.getJoinTableRecords();
  for (  Object key : joinTableRecords.keySet()) {
    Set<Object> values=joinTableRecords.get(key);
    Object joinColumnValue=key;
    Map<String,Object> columns=new HashMap<String,Object>();
    for (    Object childValue : values) {
      Object invJoinColumnValue=childValue;
      columns.put(invJoinColumnName + "String_Node_Str" + invJoinColumnValue,invJoinColumnValue);
    }
    if (columns != null && !columns.isEmpty()) {
      try {
        handler.createTableIfDoesNotExist(joinTableData.getSchemaName(),joinTableName);
        handler.writeJoinTableData(joinTableData.getSchemaName(),joinColumnValue,columns,joinTableName);
      }
 catch (      IOException e) {
        throw new PersistenceException(e);
      }
    }
  }
}
Program: 176361
Project: 176361
Buggy source:
/** 
 * Writes data into Join Table.
 * @param tableName the table name
 * @param rowId the row id
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns,String joinTableName) throws IOException ;

Fixed version (ground truth):
/** 
 * Writes data into Join Table.
 * @param tableName the table name
 * @param rowId the row id
 * @param columns the columns
 * @throws IOException Signals that an I/O exception has occurred.
 */
void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns,String columnFamilyName) throws IOException ;
Program: 176362
Project: 176362
Buggy source:
@Override public void writeData(String tableName,EntityMetadata m,Object entity,Object rowId,List<RelationHolder> relations) throws IOException {
  HTableInterface hTable=gethTable(tableName);
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set<Attribute> attributes=entityType.getAttributes();
  HBaseDataWrapper columnWrapper=new HBaseDataWrapper(rowId,new java.util.HashMap<String,Attribute>(),entity,null);
  List<HBaseDataWrapper> persistentData=new ArrayList<HBaseDataHandler.HBaseDataWrapper>(attributes.size());
  preparePersistentData(tableName,m.getTableName(),entity,rowId,metaModel,attributes,columnWrapper,persistentData);
  hbaseWriter.writeColumns(hTable,columnWrapper.getRowKey(),columnWrapper.getColumns(),entity,m.getTableName());
  for (  HBaseDataWrapper wrapper : persistentData) {
    hbaseWriter.writeColumns(hTable,wrapper.getColumnFamily(),wrapper.getRowKey(),wrapper.getColumns(),wrapper.getEntity());
  }
  boolean containsEmbeddedObjectsOnly=columnWrapper.getColumns().isEmpty() && persistentData.isEmpty();
  if (relations != null && !relations.isEmpty()) {
    hbaseWriter.writeRelations(hTable,rowId,containsEmbeddedObjectsOnly,relations,m.getTableName());
  }
  puthTable(hTable);
}

Fixed version (ground truth):
@Override public void writeData(String tableName,EntityMetadata m,Object entity,Object rowId,List<RelationHolder> relations) throws IOException {
  HTableInterface hTable=gethTable(tableName);
  MetamodelImpl metaModel=(MetamodelImpl)KunderaMetadata.INSTANCE.getApplicationMetadata().getMetamodel(m.getPersistenceUnit());
  EntityType entityType=metaModel.entity(m.getEntityClazz());
  Set<Attribute> attributes=entityType.getAttributes();
  HBaseDataWrapper columnWrapper=new HBaseDataWrapper(rowId,new java.util.HashMap<String,Attribute>(),entity,null);
  List<HBaseDataWrapper> persistentData=new ArrayList<HBaseDataHandler.HBaseDataWrapper>(attributes.size());
  preparePersistentData(tableName,m.getTableName(),entity,rowId,metaModel,attributes,columnWrapper,persistentData);
  hbaseWriter.writeColumns(hTable,columnWrapper.getRowKey(),columnWrapper.getColumns(),entity,m.getTableName());
  for (  HBaseDataWrapper wrapper : persistentData) {
    hbaseWriter.writeColumns(hTable,wrapper.getColumnFamily(),wrapper.getRowKey(),wrapper.getColumns(),wrapper.getValues(),wrapper.getEntity());
  }
  boolean containsEmbeddedObjectsOnly=columnWrapper.getColumns().isEmpty() && persistentData.isEmpty();
  if (relations != null && !relations.isEmpty()) {
    hbaseWriter.writeRelations(hTable,rowId,containsEmbeddedObjectsOnly,relations,m.getTableName());
  }
  puthTable(hTable);
}
Program: 176363
Project: 176363
Buggy source:
/** 
 * @param rowKey
 * @param columns
 * @param entity
 * @param columnFamily
 */
public HBaseDataWrapper(Object rowKey,Map<String,Attribute> columns,Object entity,String columnFamily){
  super();
  this.rowKey=rowKey;
  this.columns=columns;
  this.entity=entity;
  this.columnFamily=columnFamily;
}

Fixed version (ground truth):
public HBaseDataWrapper(Object rowKey,Map<String,Attribute> columns,Map<String,Object> values,Object entity,String columnFamily){
  super();
  this.rowKey=rowKey;
  this.columns=columns;
  this.values=values;
  this.entity=entity;
  this.columnFamily=columnFamily;
}
Program: 176364
Project: 176364
Buggy source:
@Override public void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns,String joinTableName) throws IOException {
  HTableInterface hTable=gethTable(tableName);
  hbaseWriter.writeColumns(hTable,rowId,columns,joinTableName);
  puthTable(hTable);
}

Fixed version (ground truth):
@Override public void writeJoinTableData(String tableName,Object rowId,Map<String,Object> columns,String columnFamilyName) throws IOException {
  HTableInterface hTable=gethTable(tableName);
  hbaseWriter.writeColumns(hTable,rowId,columns,columnFamilyName);
  puthTable(hTable);
}
Program: 176366
Project: 176366
Buggy source:
@Override public void persistRows(Map<HTableInterface,List<HBaseDataWrapper>> rows) throws IOException {
  List<Put> dataSet=new ArrayList<Put>(rows.size());
  for (  HTableInterface hTable : rows.keySet()) {
    List<HBaseDataWrapper> row=rows.get(hTable);
    for (    HBaseDataWrapper data : row) {
      dataSet.add(preparePut(data.getColumnFamily(),data.getRowKey(),data.getColumns(),data.getEntity()));
    }
    hTable.put(dataSet);
    dataSet.clear();
  }
}

Fixed version (ground truth):
@Override public void persistRows(Map<HTableInterface,List<HBaseDataWrapper>> rows) throws IOException {
  List<Put> dataSet=new ArrayList<Put>(rows.size());
  for (  HTableInterface hTable : rows.keySet()) {
    List<HBaseDataWrapper> row=rows.get(hTable);
    for (    HBaseDataWrapper data : row) {
      dataSet.add(preparePut(data.getColumnFamily(),data.getRowKey(),data.getColumns(),data.getValues()));
    }
    hTable.put(dataSet);
    dataSet.clear();
  }
}
Program: 176367
Project: 176367
Buggy source:
/** 
 * Prepare put.
 * @param columnFamily the column family
 * @param rowKey the row key
 * @param columns the columns
 * @param columnFamilyObj the column family obj
 * @return the put
 * @throws IOException Signals that an I/O exception has occurred.
 */
private Put preparePut(String columnFamily,Object rowKey,Map<String,Attribute> columns,Object columnFamilyObj) throws IOException {
  Put p=new Put(HBaseUtils.getBytes(rowKey));
  for (  String columnName : columns.keySet()) {
    Attribute column=columns.get(columnName);
    if (!column.isCollection() && !((SingularAttribute)column).isId()) {
      String qualifier=columnName;
      try {
        Object o=PropertyAccessorHelper.getObject(columnFamilyObj,(Field)column.getJavaMember());
        byte[] value=HBaseUtils.getBytes(o);
        if (value != null && columnFamily != null) {
          p.add(Bytes.toBytes(columnFamily),Bytes.toBytes(qualifier),value);
        }
      }
 catch (      PropertyAccessException e1) {
        throw new IOException(e1);
      }
    }
  }
  return p;
}

Fixed version (ground truth):
/** 
 * Prepare put.
 * @param columnFamily the column family
 * @param rowKey the row key
 * @param columns the columns
 * @param values TODO
 * @param columnFamilyObj the column family obj
 * @return the put
 * @throws IOException Signals that an I/O exception has occurred.
 */
private Put preparePut(String columnFamily,Object rowKey,Map<String,Attribute> columns,Map<String,Object> values) throws IOException {
  Put p=new Put(HBaseUtils.getBytes(rowKey));
  for (  String columnName : columns.keySet()) {
    Attribute column=columns.get(columnName);
    if (!column.isCollection() && !((SingularAttribute)column).isId()) {
      String qualifier=columnName;
      try {
        Object o=values.get(columnName);
        byte[] value=HBaseUtils.getBytes(o);
        if (value != null && columnFamily != null) {
          p.add(Bytes.toBytes(columnFamily),Bytes.toBytes(qualifier),value);
        }
      }
 catch (      PropertyAccessException e1) {
        throw new IOException(e1);
      }
    }
  }
  return p;
}
Program: 176368
Project: 176368
Buggy source:
/** 
 */
private void getDB(){
  Map<String,Client> clients=(Map<String,Client>)em.getDelegate();
  MongoDBClient client=(MongoDBClient)clients.get(persistenceUnit);
  if (client != null) {
    try {
      Field mongodb=client.getClass().getDeclaredField("String_Node_Str");
      if (!mongodb.isAccessible()) {
        mongodb.setAccessible(true);
      }
      db=(DB)mongodb.get(client);
    }
 catch (    SecurityException e) {
      e.printStackTrace();
    }
catch (    NoSuchFieldException e) {
      e.printStackTrace();
    }
catch (    IllegalArgumentException e) {
      e.printStackTrace();
    }
catch (    IllegalAccessException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
/** 
 */
private void getDB(){
  Map<String,Client> clients=(Map<String,Client>)em.getDelegate();
  MongoDBClient client=(MongoDBClient)clients.get(persistenceUnit);
  if (client != null) {
    try {
      Field mongodb=client.getClass().getDeclaredField("String_Node_Str");
      if (!mongodb.isAccessible()) {
        mongodb.setAccessible(true);
      }
      db=(DB)mongodb.get(client);
    }
 catch (    SecurityException e) {
      Assert.fail(e.getMessage());
    }
catch (    NoSuchFieldException e) {
      Assert.fail(e.getMessage());
    }
catch (    IllegalArgumentException e) {
      Assert.fail(e.getMessage());
    }
catch (    IllegalAccessException e) {
      Assert.fail(e.getMessage());
    }
  }
}
Program: 176373
Project: 176373
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=getConection();
    conn=getConnection(pooledConnection);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",metadata.getTableName());
    }
    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();
    conn=getConnection(pooledConnection);
    if (log.isInfoEnabled()) {
      log.info("String_Node_Str",metadata.getTableName());
    }
    conn.remove_counter((CassandraUtilities.toBytes(pKey,metadata.getIdAttribute().getJavaType())).getBytes(),path,consistencyLevel);
  }
 catch (  Exception e) {
    log.error("String_Node_Str",e);
    throw new PersistenceException(e);
  }
 finally {
    releaseConnection(pooledConnection);
  }
}
Program: 176374
Project: 176374
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=getConection();
  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",persistenceUnit,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();
  client=getConnection(pooledConnection);
  try {
    client.set_cql_version(getCqlVersion());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",persistenceUnit,e);
    throw new KunderaException(e);
  }
 finally {
    releaseConnection(pooledConnection);
  }
  return client;
}
Program: 176375
Project: 176375
Buggy source:
private Object populateCompositeId(EntityMetadata m,Object entity,String thriftColumnName,Object thriftColumnValue,MetamodelImpl metaModel) throws InstantiationException, IllegalAccessException {
  if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())) {
    EmbeddableType compoundKey=metaModel.embeddable(m.getIdAttribute().getBindableJavaType());
    Object compoundKeyObject=null;
    try {
      Set<Attribute> attributes=compoundKey.getAttributes();
      for (      Attribute compoundAttribute : attributes) {
        if (((AbstractAttribute)compoundAttribute).getJPAColumnName().equals(thriftColumnName)) {
          entity=initialize(m,entity,null);
          compoundKeyObject=compoundKeyObject == null ? getCompoundKey(m,entity) : compoundKeyObject;
          setFieldValueViaCQL(compoundKeyObject,thriftColumnValue,compoundAttribute);
          PropertyAccessorHelper.set(entity,(Field)m.getIdAttribute().getJavaMember(),compoundKeyObject);
          break;
        }
      }
    }
 catch (    IllegalArgumentException iaex) {
    }
catch (    InstantiationException iex) {
      log.error("String_Node_Str",iex);
      throw new PersistenceException(iex);
    }
catch (    IllegalAccessException iaex) {
      log.error("String_Node_Str",iaex);
      throw new PersistenceException(iaex);
    }
  }
  return entity;
}

Fixed version (ground truth):
private Object populateCompositeId(EntityMetadata m,Object entity,String thriftColumnName,Object thriftColumnValue,MetamodelImpl metaModel) throws InstantiationException, IllegalAccessException {
  if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType())) {
    EmbeddableType compoundKey=metaModel.embeddable(m.getIdAttribute().getBindableJavaType());
    Object compoundKeyObject=null;
    try {
      Set<Attribute> attributes=compoundKey.getAttributes();
      for (      Attribute compoundAttribute : attributes) {
        if (((AbstractAttribute)compoundAttribute).getJPAColumnName().equals(thriftColumnName)) {
          entity=initialize(m,entity,null);
          compoundKeyObject=compoundKeyObject == null ? getCompoundKey(m,entity) : compoundKeyObject;
          setFieldValueViaCQL(compoundKeyObject,thriftColumnValue,compoundAttribute);
          PropertyAccessorHelper.set(entity,(Field)m.getIdAttribute().getJavaMember(),compoundKeyObject);
          break;
        }
      }
    }
 catch (    IllegalArgumentException iaex) {
    }
catch (    Exception e) {
      log.error("String_Node_Str",e);
      throw new PersistenceException(e);
    }
  }
  return entity;
}
Program: 176378
Project: 176378
Buggy source:
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  CassandraCli.cassandraSetUp();
  CassandraCli.initClient();
}

Fixed version (ground truth):
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  CassandraCli.cassandraSetUp();
  CassandraCli.initClient();
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
}
Program: 176382
Project: 176382
Buggy source:
private void onassertBi1MAssociation(PersistenceDelegator delegator){
  KunderaQuery kunderaQuery;
  CoreQuery queryObj;
  PersonB1M personBi1M=new PersonB1M();
  personBi1M.setPersonId("String_Node_Str");
  personBi1M.setPersonName("String_Node_Str");
  AddressB1M addressBi1M=new AddressB1M();
  addressBi1M.setAddressId("String_Node_Str");
  addressBi1M.setStreet("String_Node_Str");
  Set<AddressB1M> addresses=new HashSet<AddressB1M>();
  addresses.add(addressBi1M);
  AddressB1M addressBi1M_copy=new AddressB1M();
  addressBi1M_copy.setAddressId("String_Node_Str");
  addressBi1M_copy.setStreet("String_Node_Str");
  addresses.add(addressBi1M_copy);
  personBi1M.setAddresses(addresses);
  em.persist(personBi1M);
  em.clear();
  String selectAssociationQuery="String_Node_Str";
  kunderaQuery=parseQuery(selectAssociationQuery);
  queryObj=new CoreQuery(selectAssociationQuery,kunderaQuery,delegator);
  List<PersonB1M> associationResults=queryObj.getResultList();
  Assert.assertTrue(!associationResults.isEmpty());
  Assert.assertNotNull(associationResults.get(0).getAddresses());
  Assert.assertEquals(2,associationResults.get(0).getAddresses().size());
  selectAssociationQuery="String_Node_Str";
  kunderaQuery=parseQuery(selectAssociationQuery);
  queryObj=new CoreQuery(selectAssociationQuery,kunderaQuery,delegator);
  associationResults=queryObj.getResultList();
  Assert.assertTrue(associationResults.isEmpty());
}

Fixed version (ground truth):
private void onassertBi1MAssociation(PersistenceDelegator delegator){
  KunderaQuery kunderaQuery;
  CoreQuery queryObj;
  PersonB1M personBi1M=new PersonB1M();
  personBi1M.setPersonId("String_Node_Str");
  personBi1M.setPersonName("String_Node_Str");
  AddressB1M addressBi1M=new AddressB1M();
  addressBi1M.setAddressId("String_Node_Str");
  addressBi1M.setStreet("String_Node_Str");
  Set<AddressB1M> addresses=new HashSet<AddressB1M>();
  addresses.add(addressBi1M);
  AddressB1M addressBi1M_copy=new AddressB1M();
  addressBi1M_copy.setAddressId("String_Node_Str");
  addressBi1M_copy.setStreet("String_Node_Str");
  addresses.add(addressBi1M_copy);
  personBi1M.setAddresses(addresses);
  em.persist(personBi1M);
  em.clear();
  String query="String_Node_Str";
  kunderaQuery=parseQuery(query);
  queryObj=new CoreQuery(query,kunderaQuery,delegator);
  List<PersonB1M> associationResults=queryObj.getResultList();
  Assert.assertTrue(!associationResults.isEmpty());
  Assert.assertNotNull(associationResults.get(0).getAddresses());
  Assert.assertEquals(2,associationResults.get(0).getAddresses().size());
  query="String_Node_Str";
  kunderaQuery=parseQuery(query);
  queryObj=new CoreQuery(query,kunderaQuery,delegator);
  associationResults=queryObj.getResultList();
  Assert.assertTrue(associationResults.isEmpty());
}
Program: 176383
Project: 176383
Buggy source:
@Test public void testContainsBasicElementCollectionField(){
  EntityMetadata m1=KunderaMetadataManager.getEntityMetadata(Article.class);
  Assert.assertNotNull(m1);
  Assert.assertTrue(MetadataUtils.containsBasicElementCollectionField(m1));
  EntityMetadata m2=KunderaMetadataManager.getEntityMetadata(SingularEntityEmbeddable.class);
  Assert.assertNotNull(m2);
  Assert.assertFalse(MetadataUtils.containsBasicElementCollectionField(m2));
}

Fixed version (ground truth):
@Test public void testContainsBasicElementCollectionField(){
  EntityMetadata m1=KunderaMetadataManager.getEntityMetadata(Article.class);
  Assert.assertNotNull(m1);
  Assert.assertTrue(MetadataUtils.containsBasicElementCollectionField(m1));
  Assert.assertNotNull(m1.toString());
  EntityMetadata m2=KunderaMetadataManager.getEntityMetadata(SingularEntityEmbeddable.class);
  Assert.assertNotNull(m2);
  Assert.assertFalse(MetadataUtils.containsBasicElementCollectionField(m2));
  Assert.assertNotNull(m2.toString());
}
Program: 176384
Project: 176384
Buggy source:
@Test public void testIsBasicElementCollectionField(){
  try {
    EntityMetadata m=KunderaMetadataManager.getEntityMetadata(Article.class);
    Field f=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertFalse(MetadataUtils.isBasicElementCollectionField(f));
    Field f1=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f1));
    Field f2=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f2));
    Field f3=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f3));
  }
 catch (  SecurityException e) {
    Assert.fail(e.getMessage());
  }
catch (  NoSuchFieldException e) {
    Assert.fail(e.getMessage());
  }
}

Fixed version (ground truth):
@Test public void testIsBasicElementCollectionField(){
  try {
    EntityMetadata m=KunderaMetadataManager.getEntityMetadata(Article.class);
    Assert.assertNotNull(m.toString());
    Field f=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertFalse(MetadataUtils.isBasicElementCollectionField(f));
    Field f1=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f1));
    Field f2=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f2));
    Field f3=Article.class.getDeclaredField("String_Node_Str");
    Assert.assertTrue(MetadataUtils.isBasicElementCollectionField(f3));
  }
 catch (  SecurityException e) {
    Assert.fail(e.getMessage());
  }
catch (  NoSuchFieldException e) {
    Assert.fail(e.getMessage());
  }
}
Program: 176385
Project: 176385
Buggy source:
@Test public void testEmbeddedCollection(){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(KunderaUser.class);
  Assert.assertNotNull(entityMetadata);
  Assert.assertTrue(entityMetadata.getIndexProperties().isEmpty());
  Assert.assertEquals(EntityMetadata.Type.SUPER_COLUMN_FAMILY,entityMetadata.getType());
}

Fixed version (ground truth):
@Test public void testEmbeddedCollection(){
  EntityMetadata entityMetadata=KunderaMetadataManager.getEntityMetadata(KunderaUser.class);
  Assert.assertNotNull(entityMetadata);
  Assert.assertTrue(entityMetadata.getIndexProperties().isEmpty());
  Assert.assertEquals(EntityMetadata.Type.SUPER_COLUMN_FAMILY,entityMetadata.getType());
  Assert.assertNotNull(entityMetadata.toString());
  entityMetadata.setCounterColumnType(false);
  Assert.assertFalse(entityMetadata.isCounterColumnType());
}