nus-yam/ex-repair huggingface dataset:
Program: 64777
Project: 64777
Buggy source:
/** 
 * update View of footer with income, expenses and difference
 * @param footer
 * @param income
 * @param expenses
 */
private void updateListViewFooter(View footer,double income,double expenses){
  if (footer == null) {
    return;
  }
  TextView txtIncome=(TextView)footer.findViewById(R.id.textViewIncome);
  TextView txtExpenses=(TextView)footer.findViewById(R.id.textViewExpenses);
  TextView txtDifference=(TextView)footer.findViewById(R.id.textViewDifference);
  txtIncome.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),income));
  txtIncome.setTypeface(null,Typeface.BOLD_ITALIC);
  txtExpenses.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),Math.abs(expenses)));
  txtExpenses.setTypeface(null,Typeface.BOLD_ITALIC);
  txtDifference.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),income - Math.abs(expenses)));
  txtDifference.setTypeface(null,Typeface.BOLD_ITALIC);
  Core core=new Core(getActivity().getApplicationContext());
  if (income - Math.abs(expenses) < 0) {
    txtDifference.setTextColor(getResources().getColor(core.resolveIdAttribute(R.attr.holo_red_color_theme)));
  }
 else {
    txtDifference.setTextColor(getResources().getColor(core.resolveIdAttribute(R.attr.holo_green_color_theme)));
  }
}

Fixed version (ground truth):
/** 
 * update View of footer with income, expenses and difference
 * @param footer
 * @param income
 * @param expenses
 */
private void updateListViewFooter(View footer,double income,double expenses){
  if (footer == null) {
    return;
  }
  TextView txtIncome=(TextView)footer.findViewById(R.id.textViewIncome);
  TextView txtExpenses=(TextView)footer.findViewById(R.id.textViewExpenses);
  TextView txtDifference=(TextView)footer.findViewById(R.id.textViewDifference);
  txtIncome.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),income));
  txtIncome.setTypeface(null,Typeface.BOLD_ITALIC);
  txtExpenses.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),Math.abs(expenses)));
  txtExpenses.setTypeface(null,Typeface.BOLD_ITALIC);
  txtDifference.setText(currencyUtils.getCurrencyFormatted(currencyUtils.getBaseCurrencyId(),income - Math.abs(expenses)));
  txtDifference.setTypeface(null,Typeface.BOLD_ITALIC);
  Core core=new Core(getActivity());
  if (income - Math.abs(expenses) < 0) {
    txtDifference.setTextColor(getResources().getColor(core.resolveIdAttribute(R.attr.holo_red_color_theme)));
  }
 else {
    txtDifference.setTextColor(getResources().getColor(core.resolveIdAttribute(R.attr.holo_green_color_theme)));
  }
}
Program: 64779
Project: 64779
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor data){
  if (getSearResultFragmentLoaderCallbacks() != null) {
    getSearResultFragmentLoaderCallbacks().onCallbackLoaderFinished(loader,data);
  }
switch (loader.getId()) {
case ID_LOADER_ALL_DATA_DETAIL:
    ((CursorAdapter)getListAdapter()).swapCursor(data);
  if (isResumed()) {
    setListShown(true);
  }
 else {
    setListShownNoAnimation(true);
  }
}
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor data){
  if (getSearResultFragmentLoaderCallbacks() != null) {
    getSearResultFragmentLoaderCallbacks().onCallbackLoaderFinished(loader,data);
  }
switch (loader.getId()) {
case ID_LOADER_ALL_DATA_DETAIL:
    AllDataAdapter adapter=(AllDataAdapter)getListAdapter();
  if (isShownBalance()) {
    adapter.setDatabase(MoneyManagerOpenHelper.getInstance(getActivity().getApplicationContext()).getReadableDatabase());
  }
adapter.swapCursor(data);
if (isResumed()) {
setListShown(true);
}
 else {
setListShownNoAnimation(true);
}
}
}
Program: 64781
Project: 64781
Buggy source:
@Override public void onItemCheckedStateChanged(ActionMode mode,int position,long id,boolean checked){
  if (getListAdapter() != null && getListAdapter() instanceof AllDataAdapter) {
    AllDataAdapter adapter=(AllDataAdapter)getListAdapter();
    adapter.setPositionChecked(position,checked);
    adapter.notifyDataSetChanged();
  }
}

Fixed version (ground truth):
@Override public void onItemCheckedStateChanged(ActionMode mode,int position,long id,boolean checked){
  if (getListHeader() != null)   position--;
  if (getListAdapter() != null && getListAdapter() instanceof AllDataAdapter) {
    AllDataAdapter adapter=(AllDataAdapter)getListAdapter();
    adapter.setPositionChecked(position,checked);
    adapter.notifyDataSetChanged();
  }
}
Program: 64783
Project: 64783
Buggy source:
/** 
 * start the activity of transaction management
 * @param transId null set if you want to do a new transaction, or transaction id
 */
private void startCheckingAccountActivity(Integer transId){
  Intent intent=new Intent(getActivity(),CheckingAccountActivity.class);
  if (transId != null) {
    intent.putExtra(CheckingAccountActivity.KEY_TRANS_ID,transId);
    intent.setAction(Intent.ACTION_EDIT);
  }
 else {
    intent.setAction(Intent.ACTION_INSERT);
  }
  startActivity(intent);
}

Fixed version (ground truth):
/** 
 * start the activity of transaction management
 * @param transId null set if you want to do a new transaction, or transaction id
 */
private void startCheckingAccountActivity(Integer transId){
  Intent intent=new Intent(getActivity(),CheckingAccountActivity.class);
  if (transId != null) {
    intent.putExtra(CheckingAccountActivity.KEY_TRANS_ID,transId);
    intent.setAction(Intent.ACTION_EDIT);
  }
 else {
    intent.putExtra(CheckingAccountActivity.KEY_ACCOUNT_ID,mAccountId);
    intent.setAction(Intent.ACTION_INSERT);
  }
  startActivity(intent);
}
Program: 64786
Project: 64786
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  Core core=new Core(this);
  if (core.isTablet()) {
    Fragment fragment=getSupportFragmentManager().findFragmentById(getResIdLayoutContent());
    if (fragment != null) {
      if (fragment instanceof AccountFragment) {
        outState.putString(KEY_CLASS_FRAGMENT_CONTENT,((AccountFragment)fragment).getNameFragment());
      }
 else       if ((!(fragment instanceof DashboardFragment)) && (!(fragment instanceof HomeFragment))) {
        outState.putString(KEY_CLASS_FRAGMENT_CONTENT,fragment.getClass().getName());
      }
      for (int i=0; i < getSupportFragmentManager().getBackStackEntryCount(); ++i) {
        getSupportFragmentManager().popBackStack();
      }
    }
  }
  outState.putBoolean(KEY_IS_AUTHENTICATED,isAuthenticated);
  outState.putBoolean(KEY_IN_AUTHENTICATION,isInAuthentication);
  outState.putBoolean(KEY_IS_SHOW_TIPS_DROPBOX2,isShowTipsDropbox2);
  super.onSaveInstanceState(outState);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  Core core=new Core(this);
  if (core.isTablet()) {
    Fragment fragment=getSupportFragmentManager().findFragmentById(getResIdLayoutContent());
    if (fragment != null) {
      if (fragment instanceof AccountFragment) {
        outState.putString(KEY_CLASS_FRAGMENT_CONTENT,((AccountFragment)fragment).getNameFragment());
      }
 else       if ((!(fragment instanceof DashboardFragment)) && (!(fragment instanceof HomeFragment))) {
        outState.putString(KEY_CLASS_FRAGMENT_CONTENT,fragment.getClass().getName());
      }
    }
  }
  outState.putBoolean(KEY_IS_AUTHENTICATED,isAuthenticated);
  outState.putBoolean(KEY_IN_AUTHENTICATION,isInAuthentication);
  outState.putBoolean(KEY_IS_SHOW_TIPS_DROPBOX2,isShowTipsDropbox2);
  outState.putInt(KEY_ORIENTATION,getResources().getConfiguration().orientation);
  super.onSaveInstanceState(outState);
}
Program: 64788
Project: 64788
Buggy source:
@Override public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  ViewHolderGroup holder;
  if (convertView == null) {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView=inflater.inflate(mLayout,null);
    holder=new ViewHolderGroup();
    holder.text1=(TextView)convertView.findViewById(android.R.id.text1);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolderGroup)convertView.getTag();
  }
  holder.text1.setText(((TableCategory)mCategories.get(groupPosition)).getCategName());
  if (holder.text1 instanceof CheckedTextView) {
    boolean isGroupChecked=mIdGroupChecked == ((TableCategory)mCategories.get(groupPosition)).getCategId();
    ((CheckedTextView)holder.text1).setChecked(isGroupChecked && mIdChildChecked == ListView.INVALID_POSITION);
    if (isGroupChecked) {
      ((ExpandableListView)parent).expandGroup(groupPosition,true);
    }
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getGroupView(int groupPosition,boolean isExpanded,View convertView,ViewGroup parent){
  ViewHolderGroup holder;
  if (convertView == null) {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView=inflater.inflate(mLayout,null);
    holder=new ViewHolderGroup();
    holder.text1=(TextView)convertView.findViewById(android.R.id.text1);
    convertView.setTag(holder);
  }
 else {
    holder=(ViewHolderGroup)convertView.getTag();
  }
  holder.text1.setText(((TableCategory)mCategories.get(groupPosition)).getCategName());
  boolean isGroupChecked=mIdGroupChecked == ((TableCategory)mCategories.get(groupPosition)).getCategId();
  if (holder.text1 instanceof CheckedTextView) {
    ((CheckedTextView)holder.text1).setChecked(isGroupChecked && mIdChildChecked == ListView.INVALID_POSITION);
    if (isGroupChecked) {
      ((ExpandableListView)parent).expandGroup(groupPosition,true);
    }
  }
 else   if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    convertView.setBackgroundColor(mContext.getResources().getColor(isGroupChecked && mIdChildChecked == ExpandableListView.INVALID_POSITION ? R.color.holo_blue_light : android.R.color.transparent));
  }
  return convertView;
}
Program: 64789
Project: 64789
Buggy source:
@Override public View getChildView(int groupPosition,int childPosition,boolean isLastChild,View convertView,ViewGroup parent){
  ViewHolderChild holder;
  if (convertView == null) {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView=inflater.inflate(mLayout,null);
    holder=new ViewHolderChild();
    holder.text1=(TextView)convertView.findViewById(android.R.id.text1);
    holder.text2=(TextView)convertView.findViewById(android.R.id.text2);
    convertView.setTag(holder);
  }
  holder=(ViewHolderChild)convertView.getTag();
  holder.text1.setText(((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getSubCategName());
  holder.text2.setText(((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getCategName());
  holder.text2.setTextColor(mContext.getResources().getColor(android.R.color.darker_gray));
  if (holder.text1 instanceof CheckedTextView) {
    ((CheckedTextView)holder.text1).setChecked(mIdChildChecked == ((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getSubCategId());
  }
  return convertView;
}

Fixed version (ground truth):
@Override public View getChildView(int groupPosition,int childPosition,boolean isLastChild,View convertView,ViewGroup parent){
  ViewHolderChild holder;
  if (convertView == null) {
    LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    convertView=inflater.inflate(mLayout,null);
    holder=new ViewHolderChild();
    holder.text1=(TextView)convertView.findViewById(android.R.id.text1);
    holder.text2=(TextView)convertView.findViewById(android.R.id.text2);
    convertView.setTag(holder);
  }
  holder=(ViewHolderChild)convertView.getTag();
  holder.text1.setText(((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getSubCategName());
  holder.text2.setText(((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getCategName());
  holder.text2.setTextColor(mContext.getResources().getColor(android.R.color.darker_gray));
  boolean isChildSelected=mIdChildChecked == ((QueryCategorySubCategory)getChild(groupPosition,childPosition)).getSubCategId();
  if (holder.text1 instanceof CheckedTextView) {
    ((CheckedTextView)holder.text1).setChecked(isChildSelected);
  }
 else   if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
    convertView.setBackgroundColor(mContext.getResources().getColor(isChildSelected ? R.color.holo_blue_light : android.R.color.transparent));
  }
  return convertView;
}
Program: 64790
Project: 64790
Buggy source:
@Override protected Boolean doInBackground(Void... params){
  AllDataAdapter allDataAdapter=(AllDataAdapter)getListAdapter();
  if (allDataAdapter == null || allDataAdapter.getCursor() == null)   return false;
  Cursor data=allDataAdapter.getCursor();
  try {
    CSVWriter csvWriter=new CSVWriter(new FileWriter(mFileName),CSVWriter.DEFAULT_SEPARATOR,CSVWriter.NO_QUOTE_CHARACTER);
    data.moveToFirst();
    while (!data.isAfterLast()) {
      String[] record=new String[7];
      record[0]=data.getString(data.getColumnIndex(QueryAllData.UserDate));
      record[1]=data.getString(data.getColumnIndex(QueryAllData.Payee));
      record[2]=Float.toString(data.getFloat(data.getColumnIndex(QueryAllData.UserDate)));
      record[3]=data.getString(data.getColumnIndex(QueryAllData.Category));
      record[4]=data.getString(data.getColumnIndex(QueryAllData.Subcategory));
      record[5]=Integer.toString(data.getInt(data.getColumnIndex(QueryAllData.TransactionNumber)));
      record[6]=data.getString(data.getColumnIndex(QueryAllData.Notes));
      csvWriter.writeNext(record);
      data.moveToNext();
    }
    csvWriter.close();
  }
 catch (  Exception e) {
    Log.e(LOGCAT,e.getMessage());
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected Boolean doInBackground(Void... params){
  AllDataAdapter allDataAdapter=(AllDataAdapter)getListAdapter();
  if (allDataAdapter == null || allDataAdapter.getCursor() == null)   return false;
  Cursor data=allDataAdapter.getCursor();
  try {
    CSVWriter csvWriter=new CSVWriter(new FileWriter(mFileName),CSVWriter.DEFAULT_SEPARATOR,CSVWriter.NO_QUOTE_CHARACTER);
    data.moveToFirst();
    while (!data.isAfterLast()) {
      String[] record=new String[7];
      record[0]=data.getString(data.getColumnIndex(QueryAllData.UserDate));
      if (!TextUtils.isEmpty(data.getString(data.getColumnIndex(QueryAllData.Payee)))) {
        record[1]=data.getString(data.getColumnIndex(QueryAllData.Payee));
      }
 else {
        record[1]=data.getString(data.getColumnIndex(QueryAllData.ToAccountName));
      }
      record[2]=Float.toString(data.getFloat(data.getColumnIndex(QueryAllData.Amount)));
      record[3]=data.getString(data.getColumnIndex(QueryAllData.Category));
      record[4]=data.getString(data.getColumnIndex(QueryAllData.Subcategory));
      record[5]=Integer.toString(data.getInt(data.getColumnIndex(QueryAllData.TransactionNumber)));
      record[6]=data.getString(data.getColumnIndex(QueryAllData.Notes));
      csvWriter.writeNext(record);
      data.moveToNext();
    }
    csvWriter.close();
  }
 catch (  Exception e) {
    Log.e(LOGCAT,e.getMessage());
    return false;
  }
  return true;
}
Program: 64792
Project: 64792
Buggy source:
@Override protected void setResult(){
  if (mAction.equals(Intent.ACTION_PICK)) {
    Intent result=new Intent();
    Cursor cursor=((SimpleCursorAdapter)getListView().getAdapter()).getCursor();
    for (int i=0; i < getListView().getCount(); i++) {
      if (getListView().isItemChecked(i)) {
        cursor.moveToPosition(i);
        result.putExtra(INTENT_RESULT_ACCOUNTID,cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
        result.putExtra(INTENT_RESULT_ACCOUNTNAME,cursor.getString(cursor.getColumnIndex(TableAccountList.ACCOUNTNAME)));
        break;
      }
    }
    getActivity().setResult(Activity.RESULT_OK,result);
  }
  return;
}

Fixed version (ground truth):
@Override protected void setResult(){
  if (mAction.equals(Intent.ACTION_PICK)) {
    Intent result=new Intent();
    Cursor cursor=((SimpleCursorAdapter)getListAdapter()).getCursor();
    for (int i=0; i < getListView().getCount(); i++) {
      if (getListView().isItemChecked(i)) {
        cursor.moveToPosition(i);
        result.putExtra(INTENT_RESULT_ACCOUNTID,cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
        result.putExtra(INTENT_RESULT_ACCOUNTNAME,cursor.getString(cursor.getColumnIndex(TableAccountList.ACCOUNTNAME)));
        break;
      }
    }
    getActivity().setResult(Activity.RESULT_OK,result);
  }
  return;
}
Program: 64793
Project: 64793
Buggy source:
@Override public boolean onContextItemSelected(MenuItem item){
  AdapterView.AdapterContextMenuInfo info=(AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
  Cursor cursor=((SimpleCursorAdapter)getListView().getAdapter()).getCursor();
  cursor.moveToPosition(info.position);
switch (item.getItemId()) {
case 0:
    startAccountListEditActivity(cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
  break;
case 1:
showDialogDeleteAccount(cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
break;
}
return false;
}

Fixed version (ground truth):
@Override public boolean onContextItemSelected(MenuItem item){
  AdapterView.AdapterContextMenuInfo info=(AdapterView.AdapterContextMenuInfo)item.getMenuInfo();
  Cursor cursor=((SimpleCursorAdapter)getListAdapter()).getCursor();
  cursor.moveToPosition(info.position);
switch (item.getItemId()) {
case 0:
    startAccountListEditActivity(cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
  break;
case 1:
showDialogDeleteAccount(cursor.getInt(cursor.getColumnIndex(TableAccountList.ACCOUNTID)));
break;
}
return false;
}
Program: 64794
Project: 64794
Buggy source:
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setShowMenuItemSearch(true);
  setEmptyText(getActivity().getResources().getString(R.string.account_empty_list));
  setHasOptionsMenu(true);
  mLayout=mAction.equals(Intent.ACTION_PICK) ? android.R.layout.simple_list_item_multiple_choice : android.R.layout.simple_list_item_1;
  registerForContextMenu(getListView());
  getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  setListShown(false);
  getLoaderManager().initLoader(ID_LOADER_ACCOUNT,null,this);
}

Fixed version (ground truth):
@Override public void onActivityCreated(Bundle savedInstanceState){
  super.onActivityCreated(savedInstanceState);
  setShowMenuItemSearch(true);
  setEmptyText(getActivity().getResources().getString(R.string.account_empty_list));
  setHasOptionsMenu(true);
  mLayout=mAction.equals(Intent.ACTION_PICK) ? android.R.layout.simple_list_item_multiple_choice : android.R.layout.simple_list_item_1;
  SimpleCursorAdapter adapter=new SimpleCursorAdapter(getActivity(),mLayout,null,new String[]{TableAccountList.ACCOUNTNAME},new int[]{android.R.id.text1},0);
  setListAdapter(adapter);
  registerForContextMenu(getListView());
  getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
  setListShown(false);
  getLoaderManager().initLoader(ID_LOADER_ACCOUNT,null,this);
}
Program: 64795
Project: 64795
Buggy source:
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor data){
switch (loader.getId()) {
case ID_LOADER_ACCOUNT:
    SimpleCursorAdapter adapter=new SimpleCursorAdapter(getActivity(),mLayout,data,new String[]{TableAccountList.ACCOUNTNAME},new int[]{android.R.id.text1},0);
  getListView().setAdapter(adapter);
if (isResumed()) {
  setListShown(true);
}
 else {
  setListShownNoAnimation(true);
}
}
}

Fixed version (ground truth):
@Override public void onLoadFinished(Loader<Cursor> loader,Cursor data){
switch (loader.getId()) {
case ID_LOADER_ACCOUNT:
    ((SimpleCursorAdapter)getListAdapter()).swapCursor(data);
  if (isResumed()) {
    setListShown(true);
  }
 else {
    setListShownNoAnimation(true);
  }
}
}
Program: 64796
Project: 64796
Buggy source:
@Override public void onCreateContextMenu(ContextMenu menu,View v,ContextMenuInfo menuInfo){
  AdapterView.AdapterContextMenuInfo info=(AdapterView.AdapterContextMenuInfo)menuInfo;
  Cursor cursor=((SimpleCursorAdapter)getListView().getAdapter()).getCursor();
  cursor.moveToPosition(info.position);
  menu.setHeaderTitle(cursor.getString(cursor.getColumnIndex(TableAccountList.ACCOUNTNAME)));
  String[] menuItems=getResources().getStringArray(R.array.context_menu);
  for (int i=0; i < menuItems.length; i++) {
    menu.add(Menu.NONE,i,i,menuItems[i]);
  }
}

Fixed version (ground truth):
@Override public void onCreateContextMenu(ContextMenu menu,View v,ContextMenuInfo menuInfo){
  AdapterView.AdapterContextMenuInfo info=(AdapterView.AdapterContextMenuInfo)menuInfo;
  Cursor cursor=((SimpleCursorAdapter)getListAdapter()).getCursor();
  cursor.moveToPosition(info.position);
  menu.setHeaderTitle(cursor.getString(cursor.getColumnIndex(TableAccountList.ACCOUNTNAME)));
  String[] menuItems=getResources().getStringArray(R.array.context_menu);
  for (int i=0; i < menuItems.length; i++) {
    menu.add(Menu.NONE,i,i,menuItems[i]);
  }
}
Program: 64797
Project: 64797
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  if (!configuration.isAutoAttach()) {
    return;
  }
  new IterableInputBatchTransactionExecutor<>(database,1000,new AllNodes(database,1000),new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node input,    int batchNumber,    int stepNumber){
      if (stepNumber == 1) {
        LOG.info("String_Node_Str" + batchNumber);
      }
      if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
        deleteTimeTreeRelationship(input);
        createTimeTreeRelationship(input);
      }
    }
  }
).execute();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  if (!configuration.isAutoAttach()) {
    return;
  }
  new IterableInputBatchTransactionExecutor<>(database,1000,new TransactionalInput<>(database,1000,new TransactionCallback<Iterable<Node>>(){
    @Override public Iterable<Node> doInTransaction(    GraphDatabaseService database) throws Exception {
      return configuration.getInclusionPolicies().getNodeInclusionPolicy().getAll(database);
    }
  }
),new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node input,    int batchNumber,    int stepNumber){
      if (stepNumber == 1) {
        LOG.info("String_Node_Str" + batchNumber);
      }
      if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
        deleteTimeTreeRelationship(input);
        createTimeTreeRelationship(input);
      }
    }
  }
).execute();
}
Program: 64798
Project: 64798
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData) throws DeliberateTransactionRollbackException {
  for (  Node created : transactionData.getAllCreatedNodes()) {
    createTimeTreeRelationship(created);
  }
  for (  Change<Node> change : transactionData.getAllChangedNodes()) {
    if (transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getTimestampProperty()) || transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getCustomTimeTreeRootProperty()) || transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getTimestampProperty())|| transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getCustomTimeTreeRootProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
      createTimeTreeRelationship(change.getCurrent());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData) throws DeliberateTransactionRollbackException {
  for (  Node created : transactionData.getAllCreatedNodes()) {
    createTimeTreeRelationship(created);
  }
  for (  Change<Node> change : transactionData.getAllChangedNodes()) {
    if (shouldReattach(transactionData,change)) {
      deleteTimeTreeRelationship(change.getPrevious());
      createTimeTreeRelationship(change.getCurrent());
    }
  }
  return null;
}
Program: 64799
Project: 64799
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData) throws DeliberateTransactionRollbackException {
  for (  Node created : transactionData.getAllCreatedNodes()) {
    createTimeTreeRelationship(created);
  }
  for (  Change<Node> change : transactionData.getAllChangedNodes()) {
    if (transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getTimestampProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
      createTimeTreeRelationship(change.getCurrent());
    }
    if (transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getCustomTimeTreeRootProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
      createTimeTreeRelationship(change.getCurrent());
    }
    if (transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getTimestampProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
    }
    if (transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getCustomTimeTreeRootProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Void beforeCommit(ImprovedTransactionData transactionData) throws DeliberateTransactionRollbackException {
  for (  Node created : transactionData.getAllCreatedNodes()) {
    createTimeTreeRelationship(created);
  }
  for (  Change<Node> change : transactionData.getAllChangedNodes()) {
    if (transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getTimestampProperty()) || transactionData.hasPropertyBeenChanged(change.getPrevious(),configuration.getCustomTimeTreeRootProperty()) || transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getTimestampProperty())|| transactionData.hasPropertyBeenDeleted(change.getPrevious(),configuration.getCustomTimeTreeRootProperty())) {
      deleteTimeTreeRelationship(change.getPrevious());
      createTimeTreeRelationship(change.getCurrent());
    }
  }
  return null;
}
Program: 64800
Project: 64800
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  if (!configuration.isAutoAttach()) {
    return;
  }
  new IterableInputBatchTransactionExecutor<>(database,1000,new TransactionCallback<Iterable<Node>>(){
    @Override public Iterable<Node> doInTransaction(    GraphDatabaseService database) throws Exception {
      return GlobalGraphOperations.at(database).getAllNodes();
    }
  }
,new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node input,    int batchNumber,    int stepNumber){
      if (stepNumber == 1) {
        LOG.info("String_Node_Str" + batchNumber);
      }
      if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
        createTimeTreeRelationship(input);
      }
    }
  }
).execute();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void initialize(GraphDatabaseService database){
  if (!configuration.isAutoAttach()) {
    return;
  }
  new IterableInputBatchTransactionExecutor<>(database,1000,new TransactionCallback<Iterable<Node>>(){
    @Override public Iterable<Node> doInTransaction(    GraphDatabaseService database) throws Exception {
      return GlobalGraphOperations.at(database).getAllNodes();
    }
  }
,new UnitOfWork<Node>(){
    @Override public void execute(    GraphDatabaseService database,    Node input,    int batchNumber,    int stepNumber){
      if (stepNumber == 1) {
        LOG.info("String_Node_Str" + batchNumber);
      }
      if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
        deleteTimeTreeRelationship(input);
        createTimeTreeRelationship(input);
      }
    }
  }
).execute();
}
Program: 64801
Project: 64801
Buggy source:
@Override public void execute(GraphDatabaseService database,Node input,int batchNumber,int stepNumber){
  if (stepNumber == 1) {
    LOG.info("String_Node_Str" + batchNumber);
  }
  if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
    createTimeTreeRelationship(input);
  }
}

Fixed version (ground truth):
@Override public void execute(GraphDatabaseService database,Node input,int batchNumber,int stepNumber){
  if (stepNumber == 1) {
    LOG.info("String_Node_Str" + batchNumber);
  }
  if (configuration.getInclusionPolicies().getNodeInclusionPolicy().include(input)) {
    deleteTimeTreeRelationship(input);
    createTimeTreeRelationship(input);
  }
}
Program: 64803
Project: 64803
Buggy source:
@Test public void multipleEventsShouldBeFetchedForATimeInstant(){
  DateTime now=DateTime.now(UTC);
  TimeInstant timeInstant=TimeInstant.now();
  Node event1, event2;
  try (Transaction tx=getDatabase().beginTx()){
    event1=getDatabase().createNode();
    event1.setProperty("String_Node_Str","String_Node_Str");
    event2=getDatabase().createNode();
    event2.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    timedEvents.attachEvent(event1,AT_TIME,timeInstant);
    timedEvents.attachEvent(event2,AT_TIME,timeInstant);
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    List<String> eventNames=new ArrayList<>();
    List<Event> events=timedEvents.getEvents(timeInstant);
    assertEquals(2,events.size());
    eventNames.add((String)events.get(0).getNode().getProperty("String_Node_Str"));
    eventNames.add((String)events.get(1).getNode().getProperty("String_Node_Str"));
    assertTrue(eventNames.contains("String_Node_Str"));
    assertTrue(eventNames.contains("String_Node_Str"));
    tx.success();
  }
 }

Fixed version (ground truth):
@Test public void multipleEventsShouldBeFetchedForATimeInstant(){
  TimeInstant timeInstant=TimeInstant.now();
  Node event1, event2;
  try (Transaction tx=getDatabase().beginTx()){
    event1=getDatabase().createNode();
    event1.setProperty("String_Node_Str","String_Node_Str");
    event2=getDatabase().createNode();
    event2.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    timedEvents.attachEvent(event1,AT_TIME,timeInstant);
    timedEvents.attachEvent(event2,AT_TIME,timeInstant);
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    List<String> eventNames=new ArrayList<>();
    List<Event> events=timedEvents.getEvents(timeInstant);
    assertEquals(2,events.size());
    eventNames.add((String)events.get(0).getNode().getProperty("String_Node_Str"));
    eventNames.add((String)events.get(1).getNode().getProperty("String_Node_Str"));
    assertTrue(eventNames.contains("String_Node_Str"));
    assertTrue(eventNames.contains("String_Node_Str"));
    tx.success();
  }
 }
Program: 64804
Project: 64804
Buggy source:
@Test public void eventShouldBeFetchedForATimeInstant(){
  DateTime now=DateTime.now(UTC);
  TimeInstant timeInstant=TimeInstant.now();
  Node event;
  try (Transaction tx=getDatabase().beginTx()){
    event=getDatabase().createNode();
    event.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    timedEvents.attachEvent(event,AT_TIME,timeInstant);
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    List<Event> events=timedEvents.getEvents(timeInstant);
    assertEquals(1,events.size());
    assertEquals("String_Node_Str",events.get(0).getNode().getProperty("String_Node_Str"));
    assertEquals("String_Node_Str",events.get(0).getRelationshipType().name());
    tx.success();
  }
 }

Fixed version (ground truth):
@Test public void eventShouldBeFetchedForATimeInstant(){
  TimeInstant timeInstant=TimeInstant.now();
  Node event;
  try (Transaction tx=getDatabase().beginTx()){
    event=getDatabase().createNode();
    event.setProperty("String_Node_Str","String_Node_Str");
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    timedEvents.attachEvent(event,AT_TIME,timeInstant);
    tx.success();
  }
   try (Transaction tx=getDatabase().beginTx()){
    List<Event> events=timedEvents.getEvents(timeInstant);
    assertEquals(1,events.size());
    assertEquals("String_Node_Str",events.get(0).getNode().getProperty("String_Node_Str"));
    assertEquals("String_Node_Str",events.get(0).getRelationshipType().name());
    tx.success();
  }
 }
Program: 64805
Project: 64805
Buggy source:
private Node getInstant(Node parent,DateTime dateTime,Resolution targetResolution,ChildNotFoundPolicy childNotFoundPolicy){
  Resolution currentResolution=currentResolution(parent);
  if (targetResolution.equals(currentResolution)) {
    return parent;
  }
  Resolution newCurrentResolution=childResolution(parent);
  Node child=findChild(parent,dateTime.get(newCurrentResolution.getDateTimeFieldType()),RETURN_NULL);
  if (child == null) {
    if (currentResolution == null) {
      return null;
    }
switch (childNotFoundPolicy) {
case RETURN_NULL:
      return null;
case RETURN_NEXT:
    return getInstantViaClosestChild(parent,dateTime,targetResolution,childNotFoundPolicy,newCurrentResolution,FIRST);
case RETURN_PREVIOUS:
  return getInstantViaClosestChild(parent,dateTime,targetResolution,childNotFoundPolicy,newCurrentResolution,LAST);
}
}
return getInstant(child,dateTime,targetResolution,childNotFoundPolicy);
}

Fixed version (ground truth):
private Node getInstant(Node parent,DateTime dateTime,Resolution targetResolution,ChildNotFoundPolicy childNotFoundPolicy){
  Resolution currentResolution=currentResolution(parent);
  if (targetResolution.equals(currentResolution)) {
    return parent;
  }
  Resolution newCurrentResolution=childResolution(parent);
  Node child=findChild(parent,dateTime.get(newCurrentResolution.getDateTimeFieldType()),RETURN_NULL);
  if (child == null) {
switch (childNotFoundPolicy) {
case RETURN_NULL:
      return null;
case RETURN_NEXT:
    return getInstantViaClosestChild(parent,dateTime,targetResolution,childNotFoundPolicy,newCurrentResolution,FIRST);
case RETURN_PREVIOUS:
  return getInstantViaClosestChild(parent,dateTime,targetResolution,childNotFoundPolicy,newCurrentResolution,LAST);
}
}
return getInstant(child,dateTime,targetResolution,childNotFoundPolicy);
}
Program: 64806
Project: 64806
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<Event> getEvents(TimeInstant startTime,TimeInstant endTime,RelationshipType type){
  List<Event> events=new ArrayList<>();
  for (  TimeInstant instant : TimeInstant.getInstants(startTime,endTime)) {
    events.addAll(getEvents(instant,type));
  }
  return events;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<Event> getEvents(TimeInstant startTime,TimeInstant endTime,RelationshipType type){
  if (startTime.isAfter(endTime)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (!startTime.compatibleWith(endTime)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  List<Event> events=new ArrayList<>();
  Node startTimeNode=timeTree.getOrCreateInstant(startTime);
  Node endTimeNode=timeTree.getOrCreateInstant(endTime);
  events.addAll(getEventsAttachedToNodeAndChildren(startTimeNode,type));
  Relationship next=startTimeNode.getSingleRelationship(NEXT,OUTGOING);
  while (next != null && !(next.getEndNode().equals(endTimeNode))) {
    Node timeInstant=next.getEndNode();
    events.addAll(getEventsAttachedToNodeAndChildren(timeInstant,type));
    next=timeInstant.getSingleRelationship(NEXT,OUTGOING);
  }
  events.addAll(getEventsAttachedToNodeAndChildren(endTimeNode,type));
  return events;
}
Program: 64807
Project: 64807
Buggy source:
/** 
 * Get the root of the time tree. Create it if it does not exist.
 * @return root of the time tree.
 */
protected Node getTimeRoot(){
  Node result;
  Iterator<Node> nodeIterator=GlobalGraphOperations.at(database).getAllNodesWithLabel(TimeTreeRoot).iterator();
  if (nodeIterator.hasNext()) {
    result=nodeIterator.next();
    if (nodeIterator.hasNext()) {
      LOG.error("String_Node_Str");
      throw new IllegalStateException("String_Node_Str");
    }
    return result;
  }
  LOG.info("String_Node_Str");
  return database.createNode(TimeTreeRoot);
}

Fixed version (ground truth):
/** 
 * Get the root of the time tree. Create it if it does not exist.
 * @return root of the time tree.
 */
protected Node getTimeRoot(){
  if (timeTreeRoot != null) {
    return timeTreeRoot;
  }
synchronized (this) {
    if (timeTreeRoot != null) {
      return timeTreeRoot;
    }
    Node result;
    Iterator<Node> nodeIterator=GlobalGraphOperations.at(database).getAllNodesWithLabel(TimeTreeRoot).iterator();
    if (nodeIterator.hasNext()) {
      result=nodeIterator.next();
      if (nodeIterator.hasNext()) {
        LOG.error("String_Node_Str");
        throw new IllegalStateException("String_Node_Str");
      }
      return result;
    }
    LOG.info("String_Node_Str");
    timeTreeRoot=database.createNode(TimeTreeRoot);
    return timeTreeRoot;
  }
}
Program: 64808
Project: 64808
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Node getNow(DateTimeZone timeZone,Resolution resolution){
  return getInstant(DateTime.now().getMillis(),timeZone,resolution);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Node getNow(DateTimeZone timeZone,Resolution resolution,Transaction tx){
  return getInstant(DateTime.now().getMillis(),timeZone,resolution,tx);
}
Program: 64809
Project: 64809
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<Node> getInstants(long startTime,long endTime,DateTimeZone timeZone,Resolution resolution){
  if (timeZone == null) {
    timeZone=this.timeZone;
  }
  if (resolution == null) {
    resolution=this.resolution;
  }
  List<Node> result=new LinkedList<>();
  MutableDateTime time=new MutableDateTime(startTime);
  while (!time.isAfter(endTime)) {
    result.add(getInstant(time.getMillis(),timeZone,resolution));
    time.add(resolution.getDateTimeFieldType().getDurationType(),1);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<Node> getInstants(long startTime,long endTime,DateTimeZone timeZone,Resolution resolution,Transaction tx){
  if (timeZone == null) {
    timeZone=this.timeZone;
  }
  if (resolution == null) {
    resolution=this.resolution;
  }
  List<Node> result=new LinkedList<>();
  MutableDateTime time=new MutableDateTime(startTime);
  while (!time.isAfter(endTime)) {
    result.add(getInstant(time.getMillis(),timeZone,resolution,tx));
    time.add(resolution.getDateTimeFieldType().getDurationType(),1);
  }
  return result;
}
Program: 64810
Project: 64810
Buggy source:
/** 
 * Get a node representing a specific time instant. If one doesn't exist, it will be created.
 * @param time       UTC time in ms from 1/1/1970.
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @return node representing a specific time instant.
 */
Node getInstant(long time,DateTimeZone timeZone,Resolution resolution);

Fixed version (ground truth):
/** 
 * Get a node representing a specific time instant. If one doesn't exist, it will be created.
 * @param time       UTC time in ms from 1/1/1970.
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @param tx         currently running transaction.
 * @return node representing a specific time instant.
 */
Node getInstant(long time,DateTimeZone timeZone,Resolution resolution,Transaction tx);
Program: 64811
Project: 64811
Buggy source:
/** 
 * Get a node representing this time instant. If one doesn't exist, it will be created.
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @return node representing the time instant when this method was called.
 */
Node getNow(DateTimeZone timeZone,Resolution resolution);

Fixed version (ground truth):
/** 
 * Get a node representing this time instant. If one doesn't exist, it will be created.
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @param tx         currently running transaction.
 * @return node representing the time instant when this method was called.
 */
Node getNow(DateTimeZone timeZone,Resolution resolution,Transaction tx);
Program: 64812
Project: 64812
Buggy source:
/** 
 * Get nodes representing all time instants in the specified range (inclusive). The ones that don't exist will be created.
 * @param startTime  UTC time in ms from 1/1/1970 of the start of the interval (inclusive).
 * @param endTime    UTC time in ms from 1/1/1970 of the end of the interval (inclusive).
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @return nodes representing all time instants in the interval, ordered chronologically.
 */
List<Node> getInstants(long startTime,long endTime,DateTimeZone timeZone,Resolution resolution);

Fixed version (ground truth):
/** 
 * Get nodes representing all time instants in the specified range (inclusive). The ones that don't exist will be created.
 * @param startTime  UTC time in ms from 1/1/1970 of the start of the interval (inclusive).
 * @param endTime    UTC time in ms from 1/1/1970 of the end of the interval (inclusive).
 * @param timeZone   specific time zone.
 * @param resolution specific resolution.
 * @param tx         currently running transaction.
 * @return nodes representing all time instants in the interval, ordered chronologically.
 */
List<Node> getInstants(long startTime,long endTime,DateTimeZone timeZone,Resolution resolution,Transaction tx);
Program: 64814
Project: 64814
Buggy source:
public BeatmapWithMods getBeatmapWithMods(){
  return new BeatmapWithMods(beatmap.getBeatmapId(),estimates.getMods());
}

Fixed version (ground truth):
public BeatmapWithMods getBeatmapWithMods(){
  return new BeatmapWithMods(beatmap.getBeatmapId(),getMods());
}
Program: 64815
Project: 64815
Buggy source:
@Override public final Response handle(String originalCommand,OsuApiUser apiUser,UserData userData) throws UserException, IOException, SQLException, InterruptedException {
  String lowerCase=originalCommand.toLowerCase();
  final String remaining;
  searchCommand: {
    if (lowerCase.equals(alias)) {
      remaining="String_Node_Str";
      break searchCommand;
    }
    if (getLevenshteinDistance(lowerCase,command) <= 2) {
      remaining="String_Node_Str";
      break searchCommand;
    }
    if (lowerCase.startsWith(aliasWithSpace)) {
      remaining=originalCommand.substring(2);
      break searchCommand;
    }
    if (lowerCase.contains("String_Node_Str")) {
      int pos=lowerCase.indexOf(' ');
      if (getLevenshteinDistance(lowerCase.substring(0,pos),command) <= 2) {
        remaining=originalCommand.substring(pos + 1);
        break searchCommand;
      }
    }
    return null;
  }
  return handleArgument(remaining,apiUser,userData);
}

Fixed version (ground truth):
@Override public final Response handle(String originalCommand,OsuApiUser apiUser,UserData userData) throws UserException, IOException, SQLException, InterruptedException {
  String lowerCase=originalCommand.toLowerCase();
  if (lowerCase.equals(alias)) {
    return handleArgument("String_Node_Str",apiUser,userData);
  }
  if (getLevenshteinDistance(lowerCase,command) <= 2) {
    return handleArgument("String_Node_Str",apiUser,userData);
  }
  if (lowerCase.startsWith(aliasWithSpace)) {
    return handleArgument(originalCommand.substring(2),apiUser,userData);
  }
  int pos=lowerCase.indexOf(' ');
  if (pos > 0 && getLevenshteinDistance(lowerCase.substring(0,pos),command) <= 2) {
    return handleArgument(originalCommand.substring(pos + 1),apiUser,userData);
  }
  return null;
}
Program: 64817
Project: 64817
Buggy source:
@Nonnull OsuApiUser getUserOrThrow(IRCBotUser user) throws UserException, SQLException, IOException, InterruptedException {
  Integer userId=resolver.resolveIRCName(user.getNick());
  if (userId != null) {
    OsuApiUser apiUser=backend.getUser(userId,60 * 60 * 1000);
    if (apiUser != null) {
      String apiUserIrcName=IrcNameResolver.getIrcUserName(apiUser);
      if (!user.getNick().equals(apiUserIrcName)) {
        resolver.setMapping(apiUserIrcName,apiUser.getUserId());
        apiUser=resolver.redownloadUser(user.getNick());
      }
    }
    if (apiUser != null) {
      return apiUser;
    }
  }
  String string=IRCBot.getRandomString(8);
  log.error("String_Node_Str" + string + "String_Node_Str"+ user.getNick());
  throw new UserException("String_Node_Str" + "String_Node_Str" + string + "String_Node_Str");
}

Fixed version (ground truth):
@Nonnull OsuApiUser getUserOrThrow(IRCBotUser user) throws UserException, SQLException, IOException, InterruptedException {
  Integer userId=resolver.resolveIRCName(user.getNick());
  if (userId != null) {
    OsuApiUser apiUser=backend.getUser(userId,60 * 60 * 1000L);
    if (apiUser != null) {
      String apiUserIrcName=IrcNameResolver.getIrcUserName(apiUser);
      if (!user.getNick().equals(apiUserIrcName)) {
        resolver.setMapping(apiUserIrcName,apiUser.getUserId());
        apiUser=resolver.redownloadUser(user.getNick());
      }
    }
    if (apiUser != null) {
      return apiUser;
    }
  }
  String string=IRCBot.getRandomString(8);
  log.error("String_Node_Str" + string + "String_Node_Str"+ user.getNick());
  throw new UserException("String_Node_Str" + "String_Node_Str" + string + "String_Node_Str");
}
Program: 64818
Project: 64818
Buggy source:
private void checkVersionInfo(final IRCBotUser user) throws SQLException, UserException {
  int userVersion=backend.getLastVisitedVersion(user.getNick());
  if (userVersion < CURRENT_VERSION) {
    if (VERSION_MESSAGE == null || user.message(VERSION_MESSAGE,false)) {
      backend.setLastVisitedVersion(user.getNick(),CURRENT_VERSION);
    }
  }
}

Fixed version (ground truth):
private void checkVersionInfo(final IRCBotUser user) throws SQLException, UserException {
  int userVersion=backend.getLastVisitedVersion(user.getNick());
  if (userVersion < CURRENT_VERSION && (VERSION_MESSAGE == null || user.message(VERSION_MESSAGE,false))) {
    backend.setLastVisitedVersion(user.getNick(),CURRENT_VERSION);
  }
}
Program: 64819
Project: 64819
Buggy source:
@Override public boolean action(String msg){
  try {
    senderSemaphore.acquire();
  }
 catch (  InterruptedException e) {
    return false;
  }
  try {
    pinger.ping((CloseableBot)user.getBot());
    user.send().action(msg);
    MDC.put(MDC_STATE,"String_Node_Str");
    log.debug("String_Node_Str" + msg);
    return true;
  }
 catch (  IOException|InterruptedException e) {
    log.error("String_Node_Str" + e.getMessage());
    return false;
  }
 finally {
    senderSemaphore.release();
  }
}

Fixed version (ground truth):
@Override public boolean action(String msg){
  try {
    senderSemaphore.acquire();
  }
 catch (  InterruptedException e) {
    Thread.currentThread().interrupt();
    return false;
  }
  try {
    pinger.ping((CloseableBot)user.getBot());
    user.send().action(msg);
    MDC.put(MDC_STATE,"String_Node_Str");
    log.debug("String_Node_Str" + msg);
    return true;
  }
 catch (  IOException|InterruptedException e) {
    log.error("String_Node_Str" + e.getMessage());
    return false;
  }
 finally {
    senderSemaphore.release();
  }
}