nus-yam/ex-repair huggingface dataset:
Program: 80105
Project: 80105
Buggy source:
/** 
 * Adds note to parent at the level specified. But it verifies that the level is one level down than the parent!
 * @param parent parent parent
 * @param id new node id
 * @param level should always be parent's level + 1
 */
private void addNodeToParentOneLevelDown(final T parent,final T id,final int level){
  if (parent == null && level != 0) {
    throw new RuntimeException("String_Node_Str" + id + "String_Node_Str"+ level+ "String_Node_Str");
  }
  if (parent != null && manager.getLevel(parent) != level - 1) {
    throw new RuntimeException("String_Node_Str" + id + "String_Node_Str"+ level+ "String_Node_Str"+ parent+ "String_Node_Str"+ manager.getLevel(parent)+ "String_Node_Str");
  }
  manager.addAfterChild(parent,id,null);
  setLastAdded(id,level);
}

Fixed version (ground truth):
/** 
 * Adds note to parent at the level specified. But it verifies that the level is one level down than the parent!
 * @param parent parent parent
 * @param id new node id
 * @param level should always be parent's level + 1
 */
private void addNodeToParentOneLevelDown(final T parent,final T id,final int level){
  if (parent == null && level != 0) {
    throw new TreeConfigurationException("String_Node_Str" + id + "String_Node_Str"+ level+ "String_Node_Str");
  }
  if (parent != null && manager.getLevel(parent) != level - 1) {
    throw new TreeConfigurationException("String_Node_Str" + id + "String_Node_Str"+ level+ "String_Node_Str"+ parent+ "String_Node_Str"+ manager.getLevel(parent)+ "String_Node_Str");
  }
  manager.addAfterChild(parent,id,null);
  setLastAdded(id,level);
}
Program: 80106
Project: 80106
Buggy source:
private void parseAttributes(final Context context,final AttributeSet attrs,final int defStyle){
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.TreeViewList);
  expandedDrawable=a.getDrawable(R.styleable.TreeViewList_src_expanded);
  if (expandedDrawable == null) {
    expandedDrawable=context.getResources().getDrawable(DEFAULT_EXPANDED_RESOURCE);
  }
  collapsedDrawable=a.getDrawable(R.styleable.TreeViewList_src_collapsed);
  if (collapsedDrawable == null) {
    collapsedDrawable=context.getResources().getDrawable(DEFAULT_COLLAPSED_RESOURCE);
  }
  indentWidth=a.getDimensionPixelSize(R.styleable.TreeViewList_indent_width,DEFAULT_INDENT);
  indicatorGravity=a.getInteger(R.styleable.TreeViewList_indicator_gravity,DEFAULT_GRAVITY);
  indicatorBackgroundDrawable=a.getDrawable(R.styleable.TreeViewList_indicator_background);
  rowBackgroundDrawable=a.getDrawable(R.styleable.TreeViewList_row_background);
  collapsible=a.getBoolean(R.styleable.TreeViewList_collapsible,true);
  handleTrackballPress=a.getBoolean(R.styleable.TreeViewList_handle_trackball_press,true);
}

Fixed version (ground truth):
private void parseAttributes(final Context context,final AttributeSet attrs){
  final TypedArray a=context.obtainStyledAttributes(attrs,R.styleable.TreeViewList);
  expandedDrawable=a.getDrawable(R.styleable.TreeViewList_src_expanded);
  if (expandedDrawable == null) {
    expandedDrawable=context.getResources().getDrawable(DEFAULT_EXPANDED_RESOURCE);
  }
  collapsedDrawable=a.getDrawable(R.styleable.TreeViewList_src_collapsed);
  if (collapsedDrawable == null) {
    collapsedDrawable=context.getResources().getDrawable(DEFAULT_COLLAPSED_RESOURCE);
  }
  indentWidth=a.getDimensionPixelSize(R.styleable.TreeViewList_indent_width,DEFAULT_INDENT);
  indicatorGravity=a.getInteger(R.styleable.TreeViewList_indicator_gravity,DEFAULT_GRAVITY);
  indicatorBackgroundDrawable=a.getDrawable(R.styleable.TreeViewList_indicator_background);
  rowBackgroundDrawable=a.getDrawable(R.styleable.TreeViewList_row_background);
  collapsible=a.getBoolean(R.styleable.TreeViewList_collapsible,true);
  handleTrackballPress=a.getBoolean(R.styleable.TreeViewList_handle_trackball_press,true);
}
Program: 80107
Project: 80107
Buggy source:
@Override public void setAdapter(final ListAdapter adapter){
  if (!(adapter instanceof TreeViewAdapter)) {
    throw new RuntimeException("String_Node_Str");
  }
  treeAdapter=(TreeViewAdapter<?>)adapter;
  syncAdapter();
  super.setAdapter(treeAdapter);
}

Fixed version (ground truth):
@Override public void setAdapter(final ListAdapter adapter){
  if (!(adapter instanceof AbstractTreeViewAdapter)) {
    throw new TreeConfigurationException("String_Node_Str");
  }
  treeAdapter=(AbstractTreeViewAdapter<?>)adapter;
  syncAdapter();
  super.setAdapter(treeAdapter);
}
Program: 80108
Project: 80108
Buggy source:
public TreeViewList(final Context context,final AttributeSet attrs,final int defStyle){
  super(context,attrs,defStyle);
  parseAttributes(context,attrs,defStyle);
}

Fixed version (ground truth):
public TreeViewList(final Context context,final AttributeSet attrs,final int defStyle){
  super(context,attrs,defStyle);
  parseAttributes(context,attrs);
}
Program: 80109
Project: 80109
Buggy source:
public InMemoryTreeNode<T> add(final int index,final T child,final boolean visible){
  childIdListCache=null;
  final InMemoryTreeNode<T> newNode=new InMemoryTreeNode<T>(child,getId(),getLevel() + 1,getId() == null ? true : visible);
  children.add(index,newNode);
  return newNode;
}

Fixed version (ground truth):
public synchronized InMemoryTreeNode<T> add(final int index,final T child,final boolean visible){
  childIdListCache=null;
  final InMemoryTreeNode<T> newNode=new InMemoryTreeNode<T>(child,getId(),getLevel() + 1,getId() == null ? true : visible);
  children.add(index,newNode);
  return newNode;
}
Program: 80110
Project: 80110
Buggy source:
private void internalDataSetChanged(){
  visibleListCache=null;
  unmodifiableVisibleList=null;
  for (  final DataSetObserver observer : observers) {
    observer.onChanged();
  }
}

Fixed version (ground truth):
private synchronized void internalDataSetChanged(){
  visibleListCache=null;
  unmodifiableVisibleList=null;
  for (  final DataSetObserver observer : observers) {
    observer.onChanged();
  }
}
Program: 80111
Project: 80111
Buggy source:
/** 
 * Adds new relation to existing tree. Child is set as the last child of the parent node. Parent has to already exist in the tree, child cannot yet exist. This method is mostly useful in case you add entries layer by layer - i.e. first top level entries, then children for all parents, then grand-children and so on.
 * @param parent parent id
 * @param child child id
 */
public void addRelation(final T parent,final T child){
  Log.d(TAG,"String_Node_Str" + parent + "String_Node_Str"+ child);
  manager.addAfterChild(parent,child,null);
  lastAddedId=child;
  lastLevel=manager.getLevel(child);
}

Fixed version (ground truth):
/** 
 * Adds new relation to existing tree. Child is set as the last child of the parent node. Parent has to already exist in the tree, child cannot yet exist. This method is mostly useful in case you add entries layer by layer - i.e. first top level entries, then children for all parents, then grand-children and so on.
 * @param parent parent id
 * @param child child id
 */
public synchronized void addRelation(final T parent,final T child){
  Log.d(TAG,"String_Node_Str" + parent + "String_Node_Str"+ child);
  manager.addAfterChild(parent,child,null);
  lastAddedId=child;
  lastLevel=manager.getLevel(child);
}
Program: 80112
Project: 80112
Buggy source:
@Override public void deleteSchema() throws GoraException {
  try {
    if (batchWriter != null)     batchWriter.close();
    batchWriter=null;
    conn.tableOperations().delete(mapping.tableName);
  }
 catch (  AccumuloException|AccumuloSecurityException|TableNotFoundException e) {
    LOG.error(e.getMessage(),e);
    throw new GoraException(e);
  }
}

Fixed version (ground truth):
@Override public void deleteSchema() throws GoraException {
  try {
    if (batchWriter != null)     batchWriter.close();
    batchWriter=null;
    conn.tableOperations().delete(mapping.tableName);
  }
 catch (  TableNotFoundException e) {
  }
catch (  AccumuloException|AccumuloSecurityException e) {
    LOG.error(e.getMessage(),e);
    throw new GoraException(e);
  }
}
Program: 80113
Project: 80113
Buggy source:
/** 
 * Deletes the underlying schema or table (or similar) in the datastore that holds the objects. This also deletes all the data associated with the schema.
 */
void deleteSchema() throws GoraException ;

Fixed version (ground truth):
/** 
 * Deletes the underlying schema or table (or similar) in the datastore that holds the objects. This also deletes all the data associated with the schema. If the schema does not exists, this operation is ignored.
 */
void deleteSchema() throws GoraException ;
Program: 80115
Project: 80115
Buggy source:
/** 
 * Returns all fields in AVRO   {@link org.apache.hadoop.io.serializer.avro.Record} record.
 * @return array of fields in string.
 */
public String[] getDocumentFields(){
  return documentToClass.keySet().toArray(new String[documentToClass.keySet().size()]);
}

Fixed version (ground truth):
/** 
 * Returns all fields in AVRO   {@link SpecificRecord} record.
 * @return array of fields in string.
 */
public String[] getDocumentFields(){
  return documentToClass.keySet().toArray(new String[documentToClass.keySet().size()]);
}
Program: 80116
Project: 80116
Buggy source:
/** 
 * Build OrientDB dataStore mapping from gora-orientdb-mapping.xml given from class path or file system location.
 */
public OrientDBMapping build(){
  if (mapping.getDocumentClass() == null)   throw new IllegalStateException("String_Node_Str");
  return mapping;
}

Fixed version (ground truth):
/** 
 * Build OrientDB dataStore mapping from gora-orientdb-mapping.xml given from class path or file system location.
 * @return mapping file {@link OrientDBMapping}
 */
public OrientDBMapping build(){
  if (mapping.getDocumentClass() == null)   throw new IllegalStateException("String_Node_Str");
  return mapping;
}
Program: 80117
Project: 80117
Buggy source:
@Override public String getSchemaName(){
  return orientDBMapping.getDocumentClass();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String getSchemaName(){
  return orientDBMapping.getDocumentClass();
}
Program: 80118
Project: 80118
Buggy source:
@Override public boolean delete(K key){
  Delete delete=new Delete();
  delete.from(orientDBMapping.getDocumentClass()).where(projection("String_Node_Str").eq(Parameter.parameter("String_Node_Str")));
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",key);
  OCommandSQL query=new OCommandSQL(delete.toString().replace("String_Node_Str","String_Node_Str"));
  ODatabaseDocumentTx deleteTx=connectionPool.acquire();
  deleteTx.activateOnCurrentThread();
  try {
    int deleteCount=deleteTx.command(query).execute(params);
    if (deleteCount == 1) {
      return true;
    }
 else {
      return false;
    }
  }
  finally {
    deleteTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean delete(K key){
  Delete delete=new Delete();
  delete.from(orientDBMapping.getDocumentClass()).where(projection("String_Node_Str").eq(Parameter.parameter("String_Node_Str")));
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",key);
  OCommandSQL query=new OCommandSQL(delete.toString().replace("String_Node_Str","String_Node_Str"));
  ODatabaseDocumentTx deleteTx=connectionPool.acquire();
  deleteTx.activateOnCurrentThread();
  try {
    int deleteCount=deleteTx.command(query).execute(params);
    if (deleteCount == 1) {
      return true;
    }
 else {
      return false;
    }
  }
  finally {
    deleteTx.close();
  }
}
Program: 80119
Project: 80119
Buggy source:
@Override public void put(K key,T val){
  if (val.isDirty()) {
    OrientDBQuery<K,T> dataStoreQuery=new OrientDBQuery<>(this);
    dataStoreQuery.setStartKey(key);
    dataStoreQuery.setEndKey(key);
    dataStoreQuery.populateOrientDBQuery(orientDBMapping,getFieldsToQuery(null),getFields());
    ODatabaseDocumentTx selectTx=connectionPool.acquire();
    selectTx.activateOnCurrentThread();
    try {
      List<ODocument> result=selectTx.command(dataStoreQuery.getOrientDBQuery()).execute(dataStoreQuery.getParams());
      if (result.size() == 1) {
        ODocument document=updateOrientDocFromAvroBean(key,val,result.get(0));
        docBatch.add(document);
      }
 else {
        ODocument document=convertAvroBeanToOrientDoc(key,val);
        docBatch.add(document);
      }
    }
  finally {
      selectTx.close();
    }
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.info("String_Node_Str" + "String_Node_Str",new Object[]{val});
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void put(K key,T val){
  if (val.isDirty()) {
    OrientDBQuery<K,T> dataStoreQuery=new OrientDBQuery<>(this);
    dataStoreQuery.setStartKey(key);
    dataStoreQuery.setEndKey(key);
    dataStoreQuery.populateOrientDBQuery(orientDBMapping,getFieldsToQuery(null),getFields());
    ODatabaseDocumentTx selectTx=connectionPool.acquire();
    selectTx.activateOnCurrentThread();
    try {
      List<ODocument> result=selectTx.command(dataStoreQuery.getOrientDBQuery()).execute(dataStoreQuery.getParams());
      if (result.size() == 1) {
        ODocument document=updateOrientDocFromAvroBean(key,val,result.get(0));
        docBatch.add(document);
      }
 else {
        ODocument document=convertAvroBeanToOrientDoc(key,val);
        docBatch.add(document);
      }
    }
  finally {
      selectTx.close();
    }
  }
 else {
    if (LOG.isDebugEnabled()) {
      LOG.info("String_Node_Str" + "String_Node_Str",new Object[]{val});
    }
  }
}
Program: 80120
Project: 80120
Buggy source:
/** 
 * Deletes enforced schema over OrientDB Document class.
 */
@Override public void deleteSchema(){
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    schemaTx.getMetadata().getSchema().dropClass(orientDBMapping.getDocumentClass());
  }
  finally {
    schemaTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Deletes enforced schema over OrientDB Document class.
 */
@Override public void deleteSchema(){
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    schemaTx.getMetadata().getSchema().dropClass(orientDBMapping.getDocumentClass());
  }
  finally {
    schemaTx.close();
  }
}
Program: 80122
Project: 80122
Buggy source:
/** 
 * Flushes locally cached to content in memory to remote OrientDB server.
 */
@Override public void flush(){
  ODatabaseDocumentTx updateTx=connectionPool.acquire();
  updateTx.activateOnCurrentThread();
  try {
    flushLock.lock();
    for (    ODocument document : docBatch) {
      updateTx.save(document);
    }
  }
  finally {
    updateTx.close();
    docBatch.clear();
    flushLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Flushes locally cached to content in memory to remote OrientDB server.
 */
@Override public void flush(){
  ODatabaseDocumentTx updateTx=connectionPool.acquire();
  updateTx.activateOnCurrentThread();
  try {
    flushLock.lock();
    for (    ODocument document : docBatch) {
      updateTx.save(document);
    }
  }
  finally {
    updateTx.close();
    docBatch.clear();
    flushLock.unlock();
  }
}
Program: 80123
Project: 80123
Buggy source:
@Override public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query) throws IOException {
  List<PartitionQuery<K,T>> partitions=new ArrayList<>();
  PartitionQueryImpl<K,T> partitionQuery=new PartitionQueryImpl<>(query);
  partitionQuery.setConf(this.getConf());
  partitions.add(partitionQuery);
  return partitions;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<PartitionQuery<K,T>> getPartitions(Query<K,T> query) throws IOException {
  List<PartitionQuery<K,T>> partitions=new ArrayList<>();
  PartitionQueryImpl<K,T> partitionQuery=new PartitionQueryImpl<>(query);
  partitionQuery.setConf(this.getConf());
  partitions.add(partitionQuery);
  return partitions;
}
Program: 80124
Project: 80124
Buggy source:
@Override public T get(K key,String[] fields){
  String[] dbFields=getFieldsToQuery(fields);
  com.github.raymanrt.orientqb.query.Query selectQuery=new com.github.raymanrt.orientqb.query.Query();
  for (  String k : dbFields) {
    String dbFieldName=orientDBMapping.getDocumentField(k);
    if (dbFieldName != null && dbFieldName.length() > 0) {
      selectQuery.select(dbFieldName);
    }
  }
  selectQuery.from(orientDBMapping.getDocumentClass()).where(projection("String_Node_Str").eq(Parameter.parameter("String_Node_Str")));
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",key);
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>(selectQuery.toString());
  ODatabaseDocumentTx selectTx=connectionPool.acquire();
  selectTx.activateOnCurrentThread();
  try {
    List<ODocument> result=selectTx.command(query).execute(params);
    if (result.size() == 1) {
      return convertOrientDocToAvroBean(result.get(0),dbFields);
    }
 else {
      return null;
    }
  }
  finally {
    selectTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public T get(K key,String[] fields){
  String[] dbFields=getFieldsToQuery(fields);
  com.github.raymanrt.orientqb.query.Query selectQuery=new com.github.raymanrt.orientqb.query.Query();
  for (  String k : dbFields) {
    String dbFieldName=orientDBMapping.getDocumentField(k);
    if (dbFieldName != null && dbFieldName.length() > 0) {
      selectQuery.select(dbFieldName);
    }
  }
  selectQuery.from(orientDBMapping.getDocumentClass()).where(projection("String_Node_Str").eq(Parameter.parameter("String_Node_Str")));
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",key);
  OSQLSynchQuery<ODocument> query=new OSQLSynchQuery<ODocument>(selectQuery.toString());
  ODatabaseDocumentTx selectTx=connectionPool.acquire();
  selectTx.activateOnCurrentThread();
  try {
    List<ODocument> result=selectTx.command(query).execute(params);
    if (result.size() == 1) {
      return convertOrientDocToAvroBean(result.get(0),dbFields);
    }
 else {
      return null;
    }
  }
  finally {
    selectTx.close();
  }
}
Program: 80125
Project: 80125
Buggy source:
@Override public Query<K,T> newQuery(){
  OrientDBQuery<K,T> query=new OrientDBQuery<K,T>(this);
  query.setFields(getFieldsToQuery(null));
  return new OrientDBQuery<K,T>(this);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Query<K,T> newQuery(){
  OrientDBQuery<K,T> query=new OrientDBQuery<K,T>(this);
  query.setFields(getFieldsToQuery(null));
  return new OrientDBQuery<K,T>(this);
}
Program: 80126
Project: 80126
Buggy source:
/** 
 * Releases resources which have been used dataStore. Eg:- OrientDB Client connection pool.
 */
@Override public void close(){
  docBatch.clear();
  remoteServerAdmin.close();
  connectionPool.close();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Releases resources which have been used dataStore. Eg:- OrientDB Client connection pool.
 */
@Override public void close(){
  docBatch.clear();
  remoteServerAdmin.close();
  connectionPool.close();
}
Program: 80127
Project: 80127
Buggy source:
/** 
 * Check whether there exist a schema enforced over OrientDB document class.
 */
@Override public boolean schemaExists(){
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    return schemaTx.getMetadata().getSchema().existsClass(orientDBMapping.getDocumentClass());
  }
  finally {
    schemaTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Check whether there exist a schema enforced over OrientDB document class.
 */
@Override public boolean schemaExists(){
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    return schemaTx.getMetadata().getSchema().existsClass(orientDBMapping.getDocumentClass());
  }
  finally {
    schemaTx.close();
  }
}
Program: 80128
Project: 80128
Buggy source:
/** 
 * Create a new class of OrientDB documents if necessary. Enforce specified schema over the document class.
 */
@Override public void createSchema(){
  if (schemaExists()) {
    return;
  }
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    OClass documentClass=schemaTx.getMetadata().getSchema().createClass(orientDBMapping.getDocumentClass());
    documentClass.createProperty("String_Node_Str",OType.getTypeByClass(super.getKeyClass())).createIndex(OClass.INDEX_TYPE.UNIQUE);
    for (    String docField : orientDBMapping.getDocumentFields()) {
      documentClass.createProperty(docField,OType.valueOf(orientDBMapping.getDocumentFieldType(docField).name()));
    }
    schemaTx.getMetadata().getSchema().reload();
  }
  finally {
    schemaTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Create a new class of OrientDB documents if necessary. Enforce specified schema over the document class.   
 */
@Override public void createSchema(){
  if (schemaExists()) {
    return;
  }
  ODatabaseDocumentTx schemaTx=connectionPool.acquire();
  schemaTx.activateOnCurrentThread();
  try {
    OClass documentClass=schemaTx.getMetadata().getSchema().createClass(orientDBMapping.getDocumentClass());
    documentClass.createProperty("String_Node_Str",OType.getTypeByClass(super.getKeyClass())).createIndex(OClass.INDEX_TYPE.UNIQUE);
    for (    String docField : orientDBMapping.getDocumentFields()) {
      documentClass.createProperty(docField,OType.valueOf(orientDBMapping.getDocumentFieldType(docField).name()));
    }
    schemaTx.getMetadata().getSchema().reload();
  }
  finally {
    schemaTx.close();
  }
}
Program: 80129
Project: 80129
Buggy source:
@Override public Result<K,T> execute(Query<K,T> query){
  String[] fields=getFieldsToQuery(query.getFields());
  OrientDBQuery dataStoreQuery;
  if (query instanceof OrientDBQuery) {
    dataStoreQuery=((OrientDBQuery)query);
  }
 else {
    dataStoreQuery=(OrientDBQuery)((PartitionQueryImpl<K,T>)query).getBaseQuery();
  }
  dataStoreQuery.populateOrientDBQuery(orientDBMapping,fields,getFields());
  ODatabaseDocumentTx selectTx=connectionPool.acquire();
  selectTx.activateOnCurrentThread();
  try {
    OConcurrentResultSet<ODocument> result=selectTx.command(dataStoreQuery.getOrientDBQuery()).execute(dataStoreQuery.getParams());
    result.setLimit((int)query.getLimit());
    return new OrientDBResult<K,T>(this,query,result);
  }
  finally {
    selectTx.close();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Result<K,T> execute(Query<K,T> query){
  String[] fields=getFieldsToQuery(query.getFields());
  OrientDBQuery dataStoreQuery;
  if (query instanceof OrientDBQuery) {
    dataStoreQuery=((OrientDBQuery)query);
  }
 else {
    dataStoreQuery=(OrientDBQuery)((PartitionQueryImpl<K,T>)query).getBaseQuery();
  }
  dataStoreQuery.populateOrientDBQuery(orientDBMapping,fields,getFields());
  ODatabaseDocumentTx selectTx=connectionPool.acquire();
  selectTx.activateOnCurrentThread();
  try {
    OConcurrentResultSet<ODocument> result=selectTx.command(dataStoreQuery.getOrientDBQuery()).execute(dataStoreQuery.getParams());
    result.setLimit((int)query.getLimit());
    return new OrientDBResult<K,T>(this,query,result);
  }
  finally {
    selectTx.close();
  }
}
Program: 80131
Project: 80131
Buggy source:
/** 
 * Extraction OrientDB dataStore properties from   {@link Properties} gora.properties file.
 * @return OrientDB client properties encapsulated inside instance of {@link OrientDBStoreParameters}
 */
public static OrientDBStoreParameters load(Properties properties){
  String propMappingFile=properties.getProperty(ORIENT_DB_MAPPING_FILE,OrientDBStore.DEFAULT_MAPPING_FILE);
  String propServerHost=properties.getProperty(ORIENT_DB_SERVER_HOST);
  String propServerPort=properties.getProperty(ORIENT_DB_SERVER_PORT);
  String propUserName=properties.getProperty(ORIENT_DB_USER_USERNAME);
  String propUserPassword=properties.getProperty(ORIENT_DB_USER_PASSWORD);
  String propDatabaseName=properties.getProperty(ORIENT_DB_DB_NAME);
  String propConnPoolSize=properties.getProperty(ORIENT_DB_CONNECTION_POOL_SIZE);
  String propStorageType=properties.getProperty(ORIENT_DB_STORAGE_TYPE);
  return new OrientDBStoreParameters(propMappingFile,propServerHost,propServerPort,propUserName,propUserPassword,propDatabaseName,propConnPoolSize,propStorageType);
}

Fixed version (ground truth):
/** 
 * Extraction OrientDB dataStore properties from   {@link Properties} gora.properties file.
 * @param properties gora.properties properties related to datastore client.
 * @return OrientDB client properties encapsulated inside instance of {@link OrientDBStoreParameters}
 */
public static OrientDBStoreParameters load(Properties properties){
  String propMappingFile=properties.getProperty(ORIENT_DB_MAPPING_FILE,OrientDBStore.DEFAULT_MAPPING_FILE);
  String propServerHost=properties.getProperty(ORIENT_DB_SERVER_HOST);
  String propServerPort=properties.getProperty(ORIENT_DB_SERVER_PORT);
  String propUserName=properties.getProperty(ORIENT_DB_USER_USERNAME);
  String propUserPassword=properties.getProperty(ORIENT_DB_USER_PASSWORD);
  String propDatabaseName=properties.getProperty(ORIENT_DB_DB_NAME);
  String propConnPoolSize=properties.getProperty(ORIENT_DB_CONNECTION_POOL_SIZE);
  String propStorageType=properties.getProperty(ORIENT_DB_STORAGE_TYPE);
  return new OrientDBStoreParameters(propMappingFile,propServerHost,propServerPort,propUserName,propUserPassword,propDatabaseName,propConnPoolSize,propStorageType);
}
Program: 80132
Project: 80132
Buggy source:
/** 
 * Method to insert the persistent objects with the given key to the aerospike database server. In writing the records, the policy defined in the mapping file is used to decide on the behaviour of transaction handling.
 * @param key        key of the object
 * @param persistent object to be persisted
 */
@Override public void put(K key,T persistent){
  Key recordKey=getAerospikeKey(key);
  List<Field> fields=persistent.getSchema().getFields();
  for (int i=0; i < fields.size(); i++) {
    if (persistent.isDirty(i)) {
      Object persistentValue=persistent.get(i);
      if (persistentValue == null && aerospikeClient.exists(null,recordKey)) {
        this.delete(key);
      }
    }
  }
  for (int i=0; i < fields.size(); i++) {
    if (!persistent.isDirty(i)) {
      continue;
    }
    Object persistentValue=persistent.get(i);
    if (persistentValue != null) {
      String mappingBinName=aerospikeParameters.getAerospikeMapping().getBinMapping().get(fields.get(i).name());
      if (mappingBinName == null) {
        LOG.error("String_Node_Str",persistent.getClass().getName(),fields.get(i).name());
        throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ fields.get(i).name()+ "String_Node_Str");
      }
      Bin bin=new Bin(mappingBinName,getSerializableValue(persistentValue,fields.get(i).schema()));
      aerospikeClient.put(aerospikeParameters.getAerospikeMapping().getWritePolicy(),recordKey,bin);
    }
  }
}

Fixed version (ground truth):
/** 
 * Method to insert the persistent objects with the given key to the aerospike database server. In writing the records, the policy defined in the mapping file is used to decide on the behaviour of transaction handling.
 * @param key        key of the object
 * @param persistent object to be persisted
 */
@Override public void put(K key,T persistent){
  Key recordKey=getAerospikeKey(key);
  List<Field> fields=persistent.getSchema().getFields();
  for (int i=0; i < fields.size(); i++) {
    if (!persistent.isDirty(i)) {
      continue;
    }
    Object persistentValue=persistent.get(i);
    String mappingBinName=aerospikeParameters.getAerospikeMapping().getBinMapping().get(fields.get(i).name());
    if (mappingBinName == null) {
      LOG.error("String_Node_Str",persistent.getClass().getName(),fields.get(i).name());
      throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ fields.get(i).name()+ "String_Node_Str");
    }
    Bin bin;
    if (persistentValue != null) {
      bin=new Bin(mappingBinName,getSerializableValue(persistentValue,fields.get(i).schema()));
    }
 else {
      bin=Bin.asNull(mappingBinName);
    }
    aerospikeClient.put(aerospikeParameters.getAerospikeMapping().getWritePolicy(),recordKey,bin);
  }
}
Program: 80133
Project: 80133
Buggy source:
@Override public void setUpClass() throws Exception {
  properties.setProperty("String_Node_Str","String_Node_Str");
  properties.setProperty("String_Node_Str",aerospikeContainer.getMappedPort(3000).toString());
}

Fixed version (ground truth):
@Override public void setUpClass() throws Exception {
  log.info("String_Node_Str");
  properties.setProperty("String_Node_Str","String_Node_Str");
  properties.setProperty("String_Node_Str",aerospikeContainer.getMappedPort(3000).toString());
}
Program: 80134
Project: 80134
Buggy source:
@Override public void tearDownClass() throws Exception {
  aerospikeContainer.stop();
}

Fixed version (ground truth):
@Override public void tearDownClass() throws Exception {
  log.info("String_Node_Str");
}
Program: 80135
Project: 80135
Buggy source:
/** 
 * Method to get the aerospike key from the provided K
 * @param key persistent key
 * @return aerospike key for the record
 */
public Key getAerospikeKey(K key){
  Value keyValue;
  if (keyClass.getSimpleName().equalsIgnoreCase("String_Node_Str")) {
    keyValue=Value.get(key.toString());
  }
 else {
    keyValue=Value.get(key);
  }
  return new Key(aerospikeParameters.getAerospikeMapping().getNamespace(),aerospikeParameters.getAerospikeMapping().getSet(),keyValue);
}

Fixed version (ground truth):
/** 
 * Method to get the aerospike key from the provided K
 * @param key persistent key
 * @return aerospike key for the record
 */
private Key getAerospikeKey(K key){
  Value keyValue;
  if (keyClass.getSimpleName().equalsIgnoreCase("String_Node_Str")) {
    keyValue=Value.get(key.toString());
  }
 else {
    keyValue=Value.get(key);
  }
  return new Key(aerospikeParameters.getAerospikeMapping().getNamespace(),aerospikeParameters.getAerospikeMapping().getSet(),keyValue);
}
Program: 80136
Project: 80136
Buggy source:
/** 
 * Method to create a statement
 * @param namespace the namespace
 * @param set       the set
 * @return the statement
 */
private Statement getStatement(String namespace,String set){
  Statement stmt=new Statement();
  stmt.setNamespace(namespace);
  stmt.setSetName(set);
  return stmt;
}

Fixed version (ground truth):
/** 
 * Method to create a Aerospike specific statement
 * @param namespace the namespace
 * @param set       the set
 * @return the statement
 */
private Statement getStatement(String namespace,String set){
  Statement stmt=new Statement();
  stmt.setNamespace(namespace);
  stmt.setSetName(set);
  return stmt;
}
Program: 80137
Project: 80137
Buggy source:
/** 
 * Instantiate a new   {@link DataStore}. Uses 'null' schema.
 * @param keyClass The key class.
 * @param persistentClass The value class.
 * @return A new store instance.
 * @throws GoraException If an error occur in creating the data store
 */
@Override public <K,T extends Persistent>DataStore<K,T> createDataStore(Class<K> keyClass,Class<T> persistentClass) throws GoraException {
  final DataStore<K,T> dataStore=DataStoreFactory.createDataStore((Class<? extends DataStore<K,T>>)dataStoreClass,keyClass,persistentClass,conf,properties);
  dataStores.add(dataStore);
  log.info("String_Node_Str",persistentClass);
  return dataStore;
}

Fixed version (ground truth):
/** 
 * Instantiate a new   {@link DataStore}. Uses 'null' schema.
 * @param keyClass        The key class.
 * @param persistentClass The value class.
 * @return A new store instance.
 * @throws GoraException If an error occur in creating the data store
 */
@Override public <K,T extends Persistent>DataStore<K,T> createDataStore(Class<K> keyClass,Class<T> persistentClass) throws GoraException {
  final DataStore<K,T> dataStore=DataStoreFactory.createDataStore((Class<? extends DataStore<K,T>>)dataStoreClass,keyClass,persistentClass,conf,properties);
  dataStores.add(dataStore);
  log.info("String_Node_Str",persistentClass);
  return dataStore;
}
Program: 80140
Project: 80140
Buggy source:
/** 
 * {@inheritDoc} Serializes the Persistent data and saves in HBase. Topmostfields of the record are persisted in "raw" format (not avro serialized). This behavior happens in maps and arrays too. ["null","type"] type (a.k.a. optional field) is persisted like as if it is ["type"], but the column get deleted if value==null (so value read after will be null).
 * @param persistent Record to be persisted in HBase
 */
@Override public void put(K key,T persistent){
  try {
    Schema schema=persistent.getSchema();
    byte[] keyRaw=toBytes(key);
    Put put=new Put(keyRaw);
    Delete delete=new Delete(keyRaw);
    List<Field> fields=schema.getFields();
    for (int i=0; i < fields.size(); i++) {
      if (!persistent.isDirty(i)) {
        continue;
      }
      Field field=fields.get(i);
      Object o=persistent.get(i);
      HBaseColumn hcol=mapping.getColumn(field.name());
      if (hcol == null) {
        throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ field.name()+ "String_Node_Str");
      }
      addPutsAndDeletes(put,delete,o,field.schema().getType(),field.schema(),hcol,hcol.getQualifier());
    }
    if (delete.size() > 0) {
      table.delete(delete);
    }
    if (put.size() > 0) {
      table.put(put);
    }
  }
 catch (  IOException ex2) {
    LOG.error(ex2.getMessage(),ex2);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} Serializes the Persistent data and saves in HBase. Topmostfields of the record are persisted in "raw" format (not avro serialized). This behavior happens in maps and arrays too. ["null","type"] type (a.k.a. optional field) is persisted like as if it is ["type"], but the column get deleted if value==null (so value read after will be null).
 * @param persistent Record to be persisted in HBase
 */
@Override public void put(K key,T persistent){
  try {
    Schema schema=persistent.getSchema();
    byte[] keyRaw=toBytes(key);
    long timeStamp=System.currentTimeMillis();
    Put put=new Put(keyRaw,timeStamp - PUTS_AND_DELETES_PUT_TS_OFFSET);
    Delete delete=new Delete(keyRaw,timeStamp - PUTS_AND_DELETES_DELETE_TS_OFFSET);
    List<Field> fields=schema.getFields();
    for (int i=0; i < fields.size(); i++) {
      if (!persistent.isDirty(i)) {
        continue;
      }
      Field field=fields.get(i);
      Object o=persistent.get(i);
      HBaseColumn hcol=mapping.getColumn(field.name());
      if (hcol == null) {
        throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ field.name()+ "String_Node_Str");
      }
      addPutsAndDeletes(put,delete,o,field.schema().getType(),field.schema(),hcol,hcol.getQualifier());
    }
    if (delete.size() > 0) {
      table.delete(delete);
    }
    if (put.size() > 0) {
      table.put(put);
    }
  }
 catch (  IOException ex2) {
    LOG.error(ex2.getMessage(),ex2);
  }
}
Program: 80141
Project: 80141
Buggy source:
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    for (    Mutation m : buffer) {
      bufMutator.mutate(m);
    }
  }
  bufMutator.flush();
  bufMutator.close();
}

Fixed version (ground truth):
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    while (!buffer.isEmpty()) {
      Mutation m=buffer.poll();
      bufMutator.mutate(m);
    }
  }
  bufMutator.flush();
  bufMutator.close();
}
Program: 80142
Project: 80142
Buggy source:
private boolean checkIfMutableFieldAndDirty(Field field){
  if (field.pos() == 0)   return false;
switch (field.schema().getType()) {
case RECORD:
case MAP:
case ARRAY:
    Object value=get(field.pos());
  return !(value instanceof Dirtyable) || value == null ? false : ((Dirtyable)value).isDirty();
case UNION:
value=get(field.pos());
return !(value instanceof Dirtyable) || value == null ? false : ((Dirtyable)value).isDirty();
default :
break;
}
return false;
}

Fixed version (ground truth):
private boolean checkIfMutableFieldAndDirty(Field field){
switch (field.schema().getType()) {
case RECORD:
case MAP:
case ARRAY:
    Object value=get(field.pos());
  return !(value instanceof Dirtyable) || value == null ? false : ((Dirtyable)value).isDirty();
case UNION:
value=get(field.pos());
return !(value instanceof Dirtyable) || value == null ? false : ((Dirtyable)value).isDirty();
default :
break;
}
return false;
}
Program: 80143
Project: 80143
Buggy source:
private void clearDirynessIfFieldIsDirtyable(int fieldIndex){
  if (fieldIndex == 0)   return;
  Object value=get(fieldIndex);
  if (value instanceof Dirtyable) {
    ((Dirtyable)value).clearDirty();
  }
}

Fixed version (ground truth):
private void clearDirynessIfFieldIsDirtyable(int fieldIndex){
  Object value=get(fieldIndex);
  if (value instanceof Dirtyable) {
    ((Dirtyable)value).clearDirty();
  }
}
Program: 80144
Project: 80144
Buggy source:
/** 
 * {@inheritDoc} Serializes the Persistent data and saves in HBase. Topmostfields of the record are persisted in "raw" format (not avro serialized). This behavior happens in maps and arrays too. ["null","type"] type (a.k.a. optional field) is persisted like as if it is ["type"], but the column get deleted if value==null (so value read after will be null).
 * @param persistent Record to be persisted in HBase
 */
@Override public void put(K key,T persistent){
  try {
    Schema schema=persistent.getSchema();
    byte[] keyRaw=toBytes(key);
    Put put=new Put(keyRaw);
    Delete delete=new Delete(keyRaw);
    List<Field> fields=schema.getFields();
    for (int i=0; i < fields.size(); i++) {
      if (!persistent.isDirty(i)) {
        continue;
      }
      Field field=fields.get(i);
      Object o=persistent.get(i);
      HBaseColumn hcol=mapping.getColumn(field.name());
      if (hcol == null) {
        throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ field.name()+ "String_Node_Str");
      }
      addPutsAndDeletes(put,delete,o,field.schema().getType(),field.schema(),hcol,hcol.getQualifier());
    }
    if (delete.size() > 0) {
      table.delete(delete);
    }
    if (put.size() > 0) {
      table.put(put);
    }
  }
 catch (  IOException ex2) {
    LOG.error(ex2.getMessage(),ex2);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} Serializes the Persistent data and saves in HBase. Topmostfields of the record are persisted in "raw" format (not avro serialized). This behavior happens in maps and arrays too. ["null","type"] type (a.k.a. optional field) is persisted like as if it is ["type"], but the column get deleted if value==null (so value read after will be null).
 * @param persistent Record to be persisted in HBase
 */
@Override public void put(K key,T persistent){
  try {
    Schema schema=persistent.getSchema();
    byte[] keyRaw=toBytes(key);
    long timeStamp=System.currentTimeMillis();
    Put put=new Put(keyRaw,timeStamp - PUTS_AND_DELETES_PUT_TS_OFFSET);
    Delete delete=new Delete(keyRaw,timeStamp - PUTS_AND_DELETES_DELETE_TS_OFFSET);
    List<Field> fields=schema.getFields();
    for (int i=0; i < fields.size(); i++) {
      if (!persistent.isDirty(i)) {
        continue;
      }
      Field field=fields.get(i);
      Object o=persistent.get(i);
      HBaseColumn hcol=mapping.getColumn(field.name());
      if (hcol == null) {
        throw new RuntimeException("String_Node_Str" + persistent.getClass().getName() + "String_Node_Str"+ field.name()+ "String_Node_Str");
      }
      addPutsAndDeletes(put,delete,o,field.schema().getType(),field.schema(),hcol,hcol.getQualifier());
    }
    if (delete.size() > 0) {
      table.delete(delete);
    }
    if (put.size() > 0) {
      table.put(put);
    }
  }
 catch (  IOException ex2) {
    LOG.error(ex2.getMessage(),ex2);
  }
}
Program: 80145
Project: 80145
Buggy source:
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    for (    Mutation m : buffer) {
      bufMutator.mutate(m);
      bufMutator.flush();
    }
  }
  bufMutator.close();
}

Fixed version (ground truth):
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    while (!buffer.isEmpty()) {
      Mutation m=buffer.poll();
      bufMutator.mutate(m);
    }
  }
  bufMutator.flush();
  bufMutator.close();
}
Program: 80147
Project: 80147
Buggy source:
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    for (    Mutation m : buffer) {
      bufMutator.mutate(m);
    }
  }
  bufMutator.flush();
  bufMutator.close();
}

Fixed version (ground truth):
public void flushCommits() throws IOException {
  BufferedMutator bufMutator=connection.getBufferedMutator(this.tableName);
  for (  ConcurrentLinkedQueue<Mutation> buffer : bPool) {
    for (    Mutation m : buffer) {
      bufMutator.mutate(m);
      bufMutator.flush();
    }
  }
  bufMutator.close();
}
Program: 80148
Project: 80148
Buggy source:
private void addFamilyOrColumn(Delete delete,HBaseColumn col,Schema fieldSchema){
switch (fieldSchema.getType()) {
case UNION:
    int index=getResolvedUnionIndex(fieldSchema);
  Schema resolvedSchema=fieldSchema.getTypes().get(index);
addFamilyOrColumn(delete,col,resolvedSchema);
break;
case MAP:
case ARRAY:
delete.addFamily(col.family);
break;
default :
delete.addColumn(col.family,col.qualifier);
break;
}
}

Fixed version (ground truth):
private void addFamilyOrColumn(Delete delete,HBaseColumn col,Schema fieldSchema){
switch (fieldSchema.getType()) {
case UNION:
    int index=getResolvedUnionIndex(fieldSchema);
  Schema resolvedSchema=fieldSchema.getTypes().get(index);
addFamilyOrColumn(delete,col,resolvedSchema);
break;
case MAP:
case ARRAY:
delete.addFamily(col.family);
break;
default :
delete.addColumns(col.family,col.qualifier);
break;
}
}
Program: 80149
Project: 80149
Buggy source:
private void addPutsAndDeletes(Put put,Delete delete,Object o,Type type,Schema schema,HBaseColumn hcol,byte[] qualifier) throws IOException {
switch (type) {
case UNION:
    if (isNullable(schema) && o == null) {
      if (qualifier == null) {
        delete.addFamily(hcol.getFamily());
      }
 else {
        delete.addColumn(hcol.getFamily(),qualifier);
      }
    }
 else {
      int index=getResolvedUnionIndex(schema);
      if (index > 1) {
        byte[] serializedBytes=toBytes(o,schema);
        put.addColumn(hcol.getFamily(),qualifier,serializedBytes);
      }
 else {
        Schema resolvedSchema=schema.getTypes().get(index);
        addPutsAndDeletes(put,delete,o,resolvedSchema.getType(),resolvedSchema,hcol,qualifier);
      }
    }
  break;
case MAP:
if (qualifier == null) {
  delete.addFamily(hcol.getFamily());
}
 else {
  delete.addColumn(hcol.getFamily(),qualifier);
}
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) Set<Entry> set=((Map)o).entrySet();
for (@SuppressWarnings("String_Node_Str") Entry entry : set) {
byte[] qual=toBytes(entry.getKey());
addPutsAndDeletes(put,delete,entry.getValue(),schema.getValueType().getType(),schema.getValueType(),hcol,qual);
}
break;
case ARRAY:
List<?> array=(List<?>)o;
int j=0;
for (Object item : array) {
addPutsAndDeletes(put,delete,item,schema.getElementType().getType(),schema.getElementType(),hcol,Bytes.toBytes(j++));
}
break;
default :
byte[] serializedBytes=toBytes(o,schema);
put.addColumn(hcol.getFamily(),qualifier,serializedBytes);
break;
}
}

Fixed version (ground truth):
private void addPutsAndDeletes(Put put,Delete delete,Object o,Type type,Schema schema,HBaseColumn hcol,byte[] qualifier) throws IOException {
switch (type) {
case UNION:
    if (isNullable(schema) && o == null) {
      if (qualifier == null) {
        delete.addFamily(hcol.getFamily());
      }
 else {
        delete.addColumns(hcol.getFamily(),qualifier);
      }
    }
 else {
      int index=getResolvedUnionIndex(schema);
      if (index > 1) {
        byte[] serializedBytes=toBytes(o,schema);
        put.addColumn(hcol.getFamily(),qualifier,serializedBytes);
      }
 else {
        Schema resolvedSchema=schema.getTypes().get(index);
        addPutsAndDeletes(put,delete,o,resolvedSchema.getType(),resolvedSchema,hcol,qualifier);
      }
    }
  break;
case MAP:
if (qualifier == null) {
  delete.addFamily(hcol.getFamily());
}
 else {
  delete.addColumns(hcol.getFamily(),qualifier);
}
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) Set<Entry> set=((Map)o).entrySet();
for (@SuppressWarnings("String_Node_Str") Entry entry : set) {
byte[] qual=toBytes(entry.getKey());
addPutsAndDeletes(put,delete,entry.getValue(),schema.getValueType().getType(),schema.getValueType(),hcol,qual);
}
break;
case ARRAY:
List<?> array=(List<?>)o;
int j=0;
for (Object item : array) {
addPutsAndDeletes(put,delete,item,schema.getElementType().getType(),schema.getElementType(),hcol,Bytes.toBytes(j++));
}
break;
default :
byte[] serializedBytes=toBytes(o,schema);
put.addColumn(hcol.getFamily(),qualifier,serializedBytes);
break;
}
}
Program: 80150
Project: 80150
Buggy source:
/** 
 * Retrieve an entry from the store with only selected fields.
 * @param key    identifier of the document in the database
 * @param fields list of fields to be loaded from the database
 */
@Override public T get(final K key,final String[] fields){
  final Map result;
  try {
    result=db.get(Map.class,key.toString());
    return newInstance(result,getFieldsToQuery(fields));
  }
 catch (  Exception e) {
    LOG.info(e.getMessage(),e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Retrieve an entry from the store with only selected fields.
 * @param key    identifier of the document in the database
 * @param fields list of fields to be loaded from the database
 */
@Override public T get(final K key,final String[] fields){
  final Map<String,Object> result;
  try {
    result=db.get(Map.class,key.toString());
    return newInstance(result,getFieldsToQuery(fields));
  }
 catch (  Exception e) {
    LOG.info(e.getMessage(),e);
    return null;
  }
}
Program: 80151
Project: 80151
Buggy source:
/** 
 * Utility method by velocity templates to generate serialVersionUID on AVRO beans.
 * @param schema Data bean AVRO schema.
 */
public static long fingerprint64(Schema schema){
  return SchemaNormalization.parsingFingerprint64(schema);
}

Fixed version (ground truth):
/** 
 * Utility method used by velocity templates to generate serialVersionUID on AVRO beans.
 * @param schema Data bean AVRO schema.
 * @return serialVersionUID for Serializable AVRO databeans.
 */
public static long fingerprint64(Schema schema){
  return SchemaNormalization.parsingFingerprint64(schema);
}
Program: 80152
Project: 80152
Buggy source:
/** 
 * @return set a {@link org.apache.gora.cassandra.query.CassandraQuery}
 */
public void setQuery(Query<K,T> query){
  this.query=query;
}

Fixed version (ground truth):
/** 
 * @param query set a {@link org.apache.gora.cassandra.query.CassandraQuery}
 */
public void setQuery(Query<K,T> query){
  this.query=query;
}
Program: 80153
Project: 80153
Buggy source:
/** 
 * Check if keyspace already exists.
 */
public boolean keyspaceExists(){
  KeyspaceDefinition keyspaceDefinition=this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
  return (keyspaceDefinition != null);
}

Fixed version (ground truth):
/** 
 * Check if keyspace already exists.
 * @return if keyspace already exists return true.
 */
public boolean keyspaceExists(){
  KeyspaceDefinition keyspaceDefinition=this.cluster.describeKeyspace(this.cassandraMapping.getKeyspaceName());
  return (keyspaceDefinition != null);
}