nus-yam/ex-repair huggingface dataset:
Program: 91144
Project: 91144
Buggy source:
@Override public void onActivityResult(final int requestCode,final int resultCode,final Intent intent){
  ActivityCompat.invalidateOptionsMenu(getActivity());
  if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddCoinapultAccountActivity.RESULT_COINAPULT) {
    UUID accountId=(UUID)intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);
    CoinapultAccount account=(CoinapultAccount)_mbwManager.getWalletManager(false).getAccount(accountId);
    _mbwManager.setSelectedAccount(accountId);
    _focusedAccount=account;
    update();
    return;
  }
  if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == Activity.RESULT_OK) {
    UUID accountid=(UUID)intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);
    WalletAccount account=_mbwManager.getWalletManager(false).getAccount(accountid);
    if (account.isActive()) {
      _mbwManager.setSelectedAccount(accountid);
    }
    _focusedAccount=account;
    update();
    if (!(account instanceof ColuAccount)) {
      setNameForNewAccount(_focusedAccount);
    }
  }
 else   if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddAdvancedAccountActivity.RESULT_MSG) {
    new AlertDialog.Builder(getActivity()).setMessage(intent.getStringExtra(AddAccountActivity.RESULT_MSG)).setPositiveButton(R.string.button_ok,null).create().show();
  }
 else {
    super.onActivityResult(requestCode,resultCode,intent);
  }
}

Fixed version (ground truth):
@Override public void onActivityResult(final int requestCode,final int resultCode,final Intent intent){
  ActivityCompat.invalidateOptionsMenu(getActivity());
  if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddCoinapultAccountActivity.RESULT_COINAPULT) {
    UUID accountId=(UUID)intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);
    CoinapultAccount account=(CoinapultAccount)_mbwManager.getWalletManager(false).getAccount(accountId);
    _mbwManager.setSelectedAccount(accountId);
    accountListAdapter.setFocusedAccount(account);
    update();
    return;
  }
  if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == Activity.RESULT_OK) {
    UUID accountid=(UUID)intent.getSerializableExtra(AddAccountActivity.RESULT_KEY);
    WalletAccount account=_mbwManager.getWalletManager(false).getAccount(accountid);
    if (account.isActive()) {
      _mbwManager.setSelectedAccount(accountid);
    }
    accountListAdapter.setFocusedAccount(account);
    update();
    if (!(account instanceof ColuAccount)) {
      setNameForNewAccount(account);
    }
  }
 else   if (requestCode == ADD_RECORD_RESULT_CODE && resultCode == AddAdvancedAccountActivity.RESULT_MSG) {
    new AlertDialog.Builder(getActivity()).setMessage(intent.getStringExtra(AddAccountActivity.RESULT_MSG)).setPositiveButton(R.string.button_ok,null).create().show();
  }
 else {
    super.onActivityResult(requestCode,resultCode,intent);
  }
}
Program: 91145
Project: 91145
Buggy source:
private void makeBackup(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_focusedAccount instanceof ColuAccount) {
    Utils.pinProtectedBackup(getActivity());
  }
 else {
    if (_focusedAccount.isDerivedFromInternalMasterseed()) {
      Utils.pinProtectedWordlistBackup(getActivity());
    }
 else     if (_focusedAccount instanceof SingleAddressAccount) {
      Utils.pinProtectedBackup(getActivity());
    }
  }
}

Fixed version (ground truth):
private void makeBackup(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  if (_focusedAccount instanceof ColuAccount) {
    Utils.pinProtectedBackup(getActivity());
  }
 else {
    if (_focusedAccount.isDerivedFromInternalMasterseed()) {
      Utils.pinProtectedWordlistBackup(getActivity());
    }
 else     if (_focusedAccount instanceof SingleAddressAccount) {
      Utils.pinProtectedBackup(getActivity());
    }
  }
}
Program: 91146
Project: 91146
Buggy source:
private void activateSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      activate(_focusedAccount);
    }
  }
);
}

Fixed version (ground truth):
private void activateSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      activate(accountListAdapter.getFocusedAccount());
    }
  }
);
}
Program: 91147
Project: 91147
Buggy source:
private void archiveSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  if (_focusedAccount instanceof CoinapultAccount) {
    _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
      @Override public void run(){
        if (!AccountsFragment.this.isAdded()) {
          return;
        }
        archive(_focusedAccount);
      }
    }
);
    return;
  }
  if (_focusedAccount instanceof Bip44Account) {
    Bip44Account account=(Bip44Account)_focusedAccount;
    if (!account.hasHadActivity()) {
      _toaster.toast(R.string.dont_allow_archiving_unused_notification,false);
      return;
    }
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      archive(_focusedAccount);
    }
  }
);
}

Fixed version (ground truth):
private void archiveSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  final WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  if (_focusedAccount instanceof CoinapultAccount) {
    _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
      @Override public void run(){
        if (!AccountsFragment.this.isAdded()) {
          return;
        }
        archive(_focusedAccount);
      }
    }
);
    return;
  }
  if (_focusedAccount instanceof Bip44Account) {
    Bip44Account account=(Bip44Account)_focusedAccount;
    if (!account.hasHadActivity()) {
      _toaster.toast(R.string.dont_allow_archiving_unused_notification,false);
      return;
    }
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      archive(_focusedAccount);
    }
  }
);
}
Program: 91148
Project: 91148
Buggy source:
/** 
 * Called when the activity is first created.
 */
@SuppressWarnings("String_Node_Str") @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  View ret=inflater.inflate(R.layout.records_activity,container,false);
  _layoutInflater=inflater;
  _separatorColor=getResources().getColor(R.color.darkgrey);
  _separatorLayoutParameters=new LayoutParams(LayoutParams.FILL_PARENT,getDipValue(1),1);
  _outerLayoutParameters=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT,1);
  _outerLayoutParameters.bottomMargin=getDipValue(8);
  _innerLayoutParameters=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT,1);
  return ret;
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 */
@SuppressWarnings("String_Node_Str") @Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.records_activity,container,false);
}
Program: 91150
Project: 91150
Buggy source:
private void signMessage(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      if (_focusedAccount instanceof CoinapultAccount) {
        CoinapultManager coinapultManager=_mbwManager.getCoinapultManager();
        MessageSigningActivity.callMe(getActivity(),coinapultManager.getAccountKey());
      }
 else       if (_focusedAccount instanceof SingleAddressAccount) {
        MessageSigningActivity.callMe(getActivity(),(SingleAddressAccount)_focusedAccount);
      }
 else       if (_focusedAccount instanceof ColuAccount) {
        MessageSigningActivity.callMe(getActivity(),((ColuAccount)_focusedAccount).getPrivateKey());
      }
 else {
        Intent intent=new Intent(getActivity(),HDSigningActivity.class);
        intent.putExtra("String_Node_Str",_focusedAccount.getId());
        startActivity(intent);
      }
    }
  }
);
}

Fixed version (ground truth):
private void signMessage(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
      if (_focusedAccount instanceof CoinapultAccount) {
        CoinapultManager coinapultManager=_mbwManager.getCoinapultManager();
        MessageSigningActivity.callMe(getActivity(),coinapultManager.getAccountKey());
      }
 else       if (_focusedAccount instanceof SingleAddressAccount) {
        MessageSigningActivity.callMe(getActivity(),(SingleAddressAccount)_focusedAccount);
      }
 else       if (_focusedAccount instanceof ColuAccount) {
        MessageSigningActivity.callMe(getActivity(),((ColuAccount)_focusedAccount).getPrivateKey());
      }
 else {
        Intent intent=new Intent(getActivity(),HDSigningActivity.class);
        intent.putExtra("String_Node_Str",_focusedAccount.getId());
        startActivity(intent);
      }
    }
  }
);
}
Program: 91151
Project: 91151
Buggy source:
private void update(){
  if (!isAdded()) {
    return;
  }
  LinearLayout llRecords=(LinearLayout)getView().findViewById(R.id.llRecords);
  llRecords.removeAllViews();
  if (_mbwManager.isKeyManagementLocked()) {
    getView().findViewById(R.id.svRecords).setVisibility(View.GONE);
    getView().findViewById(R.id.llLocked).setVisibility(View.VISIBLE);
  }
 else {
    getView().findViewById(R.id.svRecords).setVisibility(View.VISIBLE);
    getView().findViewById(R.id.llLocked).setVisibility(View.GONE);
    List<WalletAccount> activeHdAccounts=walletManager.getActiveMasterseedAccounts();
    List<WalletAccount> activeOtherAccounts=walletManager.getActiveOtherAccounts();
    List<WalletAccount> activeHdRecords=Utils.sortAccounts(activeHdAccounts,_storage);
    List<WalletAccount> activeOtherRecords=Utils.sortAccounts(activeOtherAccounts,_storage);
    List<WalletAccount> archivedRecords=Utils.sortAccounts(walletManager.getArchivedAccounts(),_storage);
    WalletAccount selectedAccount=_mbwManager.getSelectedAccount();
    CurrencySum totalSpendableBalance=new CurrencySum();
    String activeTitle=getString(R.string.active_hd_accounts_name) + (activeHdRecords.isEmpty() ? "String_Node_Str" + getString(R.string.active_accounts_empty) : "String_Node_Str");
    CurrencySum spendableBalanceHdAccounts=getSpendableBalance(activeHdAccounts);
    LinearLayout activeHdAccountsView=createAccountViewList(activeTitle,activeHdRecords,selectedAccount,spendableBalanceHdAccounts);
    llRecords.addView(activeHdAccountsView);
    totalSpendableBalance.add(spendableBalanceHdAccounts);
    if (!activeOtherRecords.isEmpty()) {
      CurrencySum spendableBalanceOtherAccounts=getSpendableBalance(activeOtherAccounts);
      LinearLayout activeOtherAccountsView=createAccountViewList(getString(R.string.active_other_accounts_name),activeOtherRecords,selectedAccount,spendableBalanceOtherAccounts);
      llRecords.addView(activeOtherAccountsView);
      totalSpendableBalance.add(spendableBalanceOtherAccounts);
      LinearLayout activeOtherSum=createActiveAccountBalanceSumView(totalSpendableBalance);
      llRecords.addView(activeOtherSum);
    }
    if (archivedRecords.size() > 0) {
      LinearLayout archived=createAccountViewList(getString(R.string.archive_name),archivedRecords,selectedAccount,null);
      llRecords.addView(archived);
    }
  }
}

Fixed version (ground truth):
private void update(){
  if (!isAdded()) {
    return;
  }
  if (_mbwManager.isKeyManagementLocked()) {
    rvRecords.setVisibility(View.GONE);
    llLocked.setVisibility(View.VISIBLE);
  }
 else {
    rvRecords.setVisibility(View.VISIBLE);
    llLocked.setVisibility(View.GONE);
    accountListAdapter.updateData();
  }
}
Program: 91152
Project: 91152
Buggy source:
private void deleteSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_focusedAccount.isActive() && _mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      deleteAccount(_focusedAccount);
    }
  }
);
}

Fixed version (ground truth):
private void deleteSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  final WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  if (_focusedAccount.isActive() && _mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      deleteAccount(_focusedAccount);
    }
  }
);
}
Program: 91154
Project: 91154
Buggy source:
private void showOutputs(){
  Intent intent=new Intent(getActivity(),UnspentOutputsActivity.class);
  intent.putExtra("String_Node_Str",_focusedAccount.getId());
  startActivity(intent);
}

Fixed version (ground truth):
private void showOutputs(){
  Intent intent=new Intent(getActivity(),UnspentOutputsActivity.class);
  WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  intent.putExtra("String_Node_Str",_focusedAccount.getId());
  startActivity(intent);
}
Program: 91155
Project: 91155
Buggy source:
private void ignoreSelectedPrivateKey(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      AlertDialog.Builder confirmDialog=new AlertDialog.Builder(getActivity());
      confirmDialog.setTitle(R.string.ignore_warnings_title);
      confirmDialog.setMessage(getString(R.string.ignore_warnings_description));
      confirmDialog.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface arg0,        int arg1){
          _mbwManager.getMetadataStorage().setIgnoreLegacyWarning(_focusedAccount.getId(),true);
          _mbwManager.getEventBus().post(new AccountChanged(_focusedAccount.getId()));
        }
      }
);
      confirmDialog.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface arg0,        int arg1){
          _mbwManager.getMetadataStorage().setIgnoreLegacyWarning(_focusedAccount.getId(),false);
          _mbwManager.getEventBus().post(new AccountChanged(_focusedAccount.getId()));
        }
      }
);
      confirmDialog.show();
    }
  }
);
}

Fixed version (ground truth):
private void ignoreSelectedPrivateKey(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      if (!AccountsFragment.this.isAdded()) {
        return;
      }
      AlertDialog.Builder confirmDialog=new AlertDialog.Builder(getActivity());
      confirmDialog.setTitle(R.string.ignore_warnings_title);
      confirmDialog.setMessage(getString(R.string.ignore_warnings_description));
      final WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
      confirmDialog.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface arg0,        int arg1){
          _mbwManager.getMetadataStorage().setIgnoreLegacyWarning(_focusedAccount.getId(),true);
          _mbwManager.getEventBus().post(new AccountChanged(_focusedAccount.getId()));
        }
      }
);
      confirmDialog.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
        public void onClick(        DialogInterface arg0,        int arg1){
          _mbwManager.getMetadataStorage().setIgnoreLegacyWarning(_focusedAccount.getId(),false);
          _mbwManager.getEventBus().post(new AccountChanged(_focusedAccount.getId()));
        }
      }
);
      confirmDialog.show();
    }
  }
);
}
Program: 91156
Project: 91156
Buggy source:
@Subscribe public void syncStarted(SyncStarted event){
  update();
}

Fixed version (ground truth):
@Subscribe public void syncStarted(SyncStarted event){
}
Program: 91157
Project: 91157
Buggy source:
private void hideSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  if (_focusedAccount instanceof Bip44Account) {
    final Bip44Account account=(Bip44Account)_focusedAccount;
    if (account.hasHadActivity()) {
      _toaster.toast(R.string.dont_allow_hiding_used_notification,false);
      return;
    }
    _mbwManager.runPinProtectedFunction(this.getActivity(),new Runnable(){
      @Override public void run(){
        _mbwManager.getWalletManager(false).removeUnusedBip44Account();
        _storage.deleteAccountMetadata(account.getId());
        _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
        _focusedAccount=null;
        finishCurrentActionMode();
      }
    }
);
  }
}

Fixed version (ground truth):
private void hideSelected(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_mbwManager.getWalletManager(false).getActiveAccounts().size() < 2) {
    _toaster.toast(R.string.keep_one_active,false);
    return;
  }
  final WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  if (_focusedAccount instanceof Bip44Account) {
    final Bip44Account account=(Bip44Account)_focusedAccount;
    if (account.hasHadActivity()) {
      _toaster.toast(R.string.dont_allow_hiding_used_notification,false);
      return;
    }
    _mbwManager.runPinProtectedFunction(this.getActivity(),new Runnable(){
      @Override public void run(){
        _mbwManager.getWalletManager(false).removeUnusedBip44Account();
        _storage.deleteAccountMetadata(account.getId());
        _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
        accountListAdapter.setFocusedAccount(null);
        finishCurrentActionMode();
      }
    }
);
  }
}
Program: 91158
Project: 91158
Buggy source:
private void rescan(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  _focusedAccount.dropCachedData();
  _mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
  _mbwManager.getColuManager().startSynchronization();
}

Fixed version (ground truth):
private void rescan(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  accountListAdapter.getFocusedAccount().dropCachedData();
  _mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
  _mbwManager.getColuManager().startSynchronization();
}
Program: 91159
Project: 91159
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int itemId=item.getItemId();
switch (itemId) {
case R.id.miColdStorage:
    InstantWalletActivity.callMe(this);
  return true;
case R.id.miSettings:
{
  Intent intent=new Intent(this,SettingsActivity.class);
  startActivityForResult(intent,REQUEST_SETTING_CHANGED);
  return true;
}
case R.id.miBackup:
Utils.pinProtectedWordlistBackup(this);
return true;
case R.id.miRefresh:
SyncMode syncMode=SyncMode.NORMAL_FORCED;
if (new Random().nextInt(5) == 0) {
syncMode=SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED;
}
 else if (mViewPager.getCurrentItem() == TAB_ID_ACCOUNTS) {
syncMode=SyncMode.NORMAL_ALL_ACCOUNTS_FORCED;
}
_mbwManager.getWalletManager(false).startSynchronization(syncMode);
_mbwManager.getColuManager().startSynchronization();
_mbwManager.getExchangeRateManager().requestOptionalRefresh();
break;
case R.id.miHelp:
openMyceliumHelp();
break;
case R.id.miAbout:
{
Intent intent=new Intent(this,AboutActivity.class);
startActivity(intent);
break;
}
case R.id.miRescanTransactions:
_mbwManager.getSelectedAccount().dropCachedData();
_mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
_mbwManager.getColuManager().startSynchronization();
break;
case R.id.miExportHistory:
shareTransactionHistory();
break;
case R.id.miVerifyMessage:
startActivity(new Intent(this,MessageVerifyActivity.class));
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int itemId=item.getItemId();
switch (itemId) {
case R.id.miColdStorage:
    InstantWalletActivity.callMe(this);
  return true;
case R.id.miSettings:
{
  Intent intent=new Intent(this,SettingsActivity.class);
  startActivityForResult(intent,REQUEST_SETTING_CHANGED);
  return true;
}
case R.id.miBackup:
Utils.pinProtectedWordlistBackup(this);
return true;
case R.id.miRefresh:
SyncMode syncMode=SyncMode.NORMAL_FORCED;
if (new Random().nextInt(5) == 0) {
syncMode=SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED;
}
 else if (mViewPager.getCurrentItem() == TAB_ID_ACCOUNTS) {
syncMode=SyncMode.NORMAL_ALL_ACCOUNTS_FORCED;
}
_mbwManager.getWalletManager(false).startSynchronization(syncMode);
_mbwManager.getColuManager().startSynchronization();
_mbwManager.getExchangeRateManager().requestOptionalRefresh();
return true;
case R.id.miHelp:
openMyceliumHelp();
break;
case R.id.miAbout:
{
Intent intent=new Intent(this,AboutActivity.class);
startActivity(intent);
break;
}
case R.id.miRescanTransactions:
_mbwManager.getSelectedAccount().dropCachedData();
_mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
_mbwManager.getColuManager().startSynchronization();
break;
case R.id.miExportHistory:
shareTransactionHistory();
break;
case R.id.miVerifyMessage:
startActivity(new Intent(this,MessageVerifyActivity.class));
break;
}
return super.onOptionsItemSelected(item);
}
Program: 91160
Project: 91160
Buggy source:
public void setRefreshAnimation(){
  if (refreshItem != null) {
    if (_mbwManager.getWalletManager(false).getState() == WalletManager.State.SYNCHRONIZING || _mbwManager.getColuManager().getState() == WalletManager.State.SYNCHRONIZING) {
      MenuItem menuItem=MenuItemCompat.setActionView(refreshItem,R.layout.actionbar_indeterminate_progress);
      ImageView ivTorIcon=(ImageView)menuItem.getActionView().findViewById(R.id.ivTorIcon);
      if (_mbwManager.getTorMode() == ServerEndpointType.Types.ONLY_TOR && _mbwManager.getTorManager() != null) {
        ivTorIcon.setVisibility(View.VISIBLE);
        if (_mbwManager.getTorManager().getInitState() == 100) {
          ivTorIcon.setImageResource(R.drawable.tor);
        }
 else {
          ivTorIcon.setImageResource(R.drawable.tor_gray);
        }
      }
 else {
        ivTorIcon.setVisibility(View.GONE);
      }
    }
 else {
      MenuItemCompat.setActionView(refreshItem,null);
    }
  }
}

Fixed version (ground truth):
public void setRefreshAnimation(){
  if (refreshItem != null) {
    if (_mbwManager.getWalletManager(false).getState() == WalletManager.State.SYNCHRONIZING || _mbwManager.getColuManager().getState() == WalletManager.State.SYNCHRONIZING) {
      if (commonSyncState != WalletManager.State.SYNCHRONIZING) {
        commonSyncState=WalletManager.State.SYNCHRONIZING;
        MenuItem menuItem=MenuItemCompat.setActionView(refreshItem,R.layout.actionbar_indeterminate_progress);
        ImageView ivTorIcon=(ImageView)menuItem.getActionView().findViewById(R.id.ivTorIcon);
        if (_mbwManager.getTorMode() == ServerEndpointType.Types.ONLY_TOR && _mbwManager.getTorManager() != null) {
          ivTorIcon.setVisibility(View.VISIBLE);
          if (_mbwManager.getTorManager().getInitState() == 100) {
            ivTorIcon.setImageResource(R.drawable.tor);
          }
 else {
            ivTorIcon.setImageResource(R.drawable.tor_gray);
          }
        }
 else {
          ivTorIcon.setVisibility(View.GONE);
        }
      }
    }
 else {
      commonSyncState=WalletManager.State.READY;
      MenuItemCompat.setActionView(refreshItem,null);
    }
  }
}
Program: 91162
Project: 91162
Buggy source:
public PoolStatisticInfo getStatistics(){
  Long totalRmcHashrate=getHashRate();
  if (totalRmcHashrate == null)   totalRmcHashrate=0L;
  Long yourRmcHashrate=getYourRmcHahrate(coluAccount.getAddress());
  if (yourRmcHashrate == null)   yourRmcHashrate=0L;
  return new PoolStatisticInfo(totalRmcHashrate,yourRmcHashrate);
}

Fixed version (ground truth):
public PoolStatisticInfo getStatistics(){
  Long totalRmcHashrate=getHashRate();
  if (totalRmcHashrate == null) {
    totalRmcHashrate=0L;
  }
  Long yourRmcHashrate=getYourRmcHahrate(coluAccount.getAddress());
  if (yourRmcHashrate == null) {
    yourRmcHashrate=0L;
  }
  return new PoolStatisticInfo(totalRmcHashrate,yourRmcHashrate);
}
Program: 91163
Project: 91163
Buggy source:
private Long getYourRmcHahrate(Address address){
  HttpRequestFactory requestFactory=new NetHttpTransport().createRequestFactory(new HttpRequestInitializer(){
    @Override public void initialize(    HttpRequest request){
      request.setParser(new JsonObjectParser(new JacksonFactory()));
    }
  }
);
  try {
    HttpRequest request=requestFactory.buildGetRequest(new GenericUrl(YOUR_RMC_HASHRATE_INFO_URL + address.toString()));
    HttpResponse response=request.execute();
    InputStream inputStream=response.getContent();
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    IOUtils.copy(inputStream,baos,true);
    return Long.parseLong(baos.toString().replace("String_Node_Str","String_Node_Str"));
  }
 catch (  Exception ex) {
  }
  return null;
}

Fixed version (ground truth):
private Long getYourRmcHahrate(Address address){
  HttpRequestFactory requestFactory=new NetHttpTransport().createRequestFactory(new HttpRequestInitializer(){
    @Override public void initialize(    HttpRequest request){
      request.setParser(new JsonObjectParser(new JacksonFactory()));
    }
  }
);
  try {
    HttpRequest request=requestFactory.buildGetRequest(new GenericUrl(YOUR_RMC_HASHRATE_INFO_URL + address.toString()));
    HttpResponse response=request.execute();
    InputStream inputStream=response.getContent();
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    IOUtils.copy(inputStream,baos,true);
    return Long.parseLong(baos.toString().replace("String_Node_Str","String_Node_Str"));
  }
 catch (  Exception ignored) {
  }
  return null;
}
Program: 91164
Project: 91164
Buggy source:
private Long getHashRate(){
  HttpRequestFactory requestFactory=new NetHttpTransport().createRequestFactory(new HttpRequestInitializer(){
    @Override public void initialize(    HttpRequest request){
      request.setParser(new JsonObjectParser(new JacksonFactory()));
    }
  }
);
  try {
    HttpRequest request=requestFactory.buildGetRequest(new GenericUrl(HASHRATE_INFO_API_URL));
    HttpResponse response=request.execute();
    InputStream inputStream=response.getContent();
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    IOUtils.copy(inputStream,baos,true);
    return Long.parseLong(baos.toString().replace("String_Node_Str","String_Node_Str"));
  }
 catch (  Exception ex) {
  }
  return null;
}

Fixed version (ground truth):
private Long getHashRate(){
  HttpRequestFactory requestFactory=new NetHttpTransport().createRequestFactory(new HttpRequestInitializer(){
    @Override public void initialize(    HttpRequest request){
      request.setParser(new JsonObjectParser(new JacksonFactory()));
    }
  }
);
  try {
    HttpRequest request=requestFactory.buildGetRequest(new GenericUrl(HASHRATE_INFO_API_URL));
    HttpResponse response=request.execute();
    InputStream inputStream=response.getContent();
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    IOUtils.copy(inputStream,baos,true);
    return Long.parseLong(baos.toString().replace("String_Node_Str","String_Node_Str"));
  }
 catch (  Exception ignored) {
  }
  return null;
}
Program: 91165
Project: 91165
Buggy source:
public ColuAccount(ColuManager manager,AccountBacking backing,MetadataStorage metadataStorage,InMemoryPrivateKey accountKey,ExchangeRateManager exchangeRateManager,Handler handler,Bus eventBus,WapiLogger logger,ColuAsset coluAsset){
  this.accountBacking=backing;
  this.manager=manager;
  this.eventBus=eventBus;
  this.handler=handler;
  this.exchangeRateManager=exchangeRateManager;
  this.metadataStorage=metadataStorage;
  this.coluAsset=coluAsset;
  this.satoshiAmount=0;
  this.accountKey=accountKey;
  this.address=this.accountKey.getPublicKey().toAddress(manager.getNetwork());
  uuid=getGuidForAsset(coluAsset,accountKey.getPublicKey().toAddress(getNetwork()).getAllAddressBytes());
  archived=metadataStorage.getArchived(uuid);
}

Fixed version (ground truth):
public ColuAccount(ColuManager manager,AccountBacking backing,MetadataStorage metadataStorage,InMemoryPrivateKey accountKey,ExchangeRateManager exchangeRateManager,ColuAsset coluAsset){
  this.accountBacking=backing;
  this.manager=manager;
  this.exchangeRateManager=exchangeRateManager;
  this.metadataStorage=metadataStorage;
  this.coluAsset=coluAsset;
  this.satoshiAmount=0;
  this.accountKey=accountKey;
  this.address=this.accountKey.getPublicKey().toAddress(manager.getNetwork());
  uuid=getGuidForAsset(coluAsset,accountKey.getPublicKey().toAddress(getNetwork()).getAllAddressBytes());
  archived=metadataStorage.getArchived(uuid);
}
Program: 91166
Project: 91166
Buggy source:
private ColuAccount createAccount(ColuAccount.ColuAsset coluAsset,InMemoryPrivateKey importKey){
  if (coluAsset == null) {
    Log.e(TAG,"String_Node_Str");
    return null;
  }
  InMemoryPrivateKey accountKey;
  CreatedAccountInfo createdAccountInfo;
  try {
    if (importKey != null) {
      accountKey=importKey;
    }
 else {
      accountKey=new InMemoryPrivateKey(mgr.getRandomSource(),true);
    }
    createdAccountInfo=createSingleAddressAccount(accountKey,AesKeyCipher.defaultKeyCipher());
    addAssetAccountUUID(coluAsset,createdAccountInfo.id);
    Log.d(TAG,"String_Node_Str" + accountKey.getBase58EncodedPrivateKey(getNetwork()));
  }
 catch (  KeyCipher.InvalidKeyCipher invalidKeyCipher) {
    throw new RuntimeException(invalidKeyCipher);
  }
  ColuAccount account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,accountKey,exchangeRateManager,handler,eventBus,logger,coluAsset);
  coluAccounts.put(account.getId(),account);
  createColuAccountLabel(account);
  loadSingleAddressAccounts();
  return account;
}

Fixed version (ground truth):
private ColuAccount createAccount(ColuAccount.ColuAsset coluAsset,InMemoryPrivateKey importKey){
  if (coluAsset == null) {
    Log.e(TAG,"String_Node_Str");
    return null;
  }
  InMemoryPrivateKey accountKey;
  CreatedAccountInfo createdAccountInfo;
  try {
    if (importKey != null) {
      accountKey=importKey;
    }
 else {
      accountKey=new InMemoryPrivateKey(mgr.getRandomSource(),true);
    }
    createdAccountInfo=createSingleAddressAccount(accountKey,AesKeyCipher.defaultKeyCipher());
    addAssetAccountUUID(coluAsset,createdAccountInfo.id);
    Log.d(TAG,"String_Node_Str" + accountKey.getBase58EncodedPrivateKey(getNetwork()));
  }
 catch (  KeyCipher.InvalidKeyCipher invalidKeyCipher) {
    throw new RuntimeException(invalidKeyCipher);
  }
  ColuAccount account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,accountKey,exchangeRateManager,coluAsset);
  coluAccounts.put(account.getId(),account);
  createColuAccountLabel(account);
  loadSingleAddressAccounts();
  return account;
}
Program: 91167
Project: 91167
Buggy source:
private void loadColuAccount(ColuAccount.ColuAsset coluAsset,UUID uuid){
  try {
    Log.d(TAG,"String_Node_Str" + uuid.toString());
    CreatedAccountInfo createdAccountInfo=new CreatedAccountInfo();
    SingleAddressAccount singleAddressAccount;
    if (!_walletAccounts.containsKey(uuid))     return;
    createdAccountInfo.id=uuid;
    singleAddressAccount=(SingleAddressAccount)_walletAccounts.get(createdAccountInfo.id);
    InMemoryPrivateKey accountKey=singleAddressAccount.getPrivateKey(AesKeyCipher.defaultKeyCipher());
    createdAccountInfo.accountBacking=singleAddressAccount.getAccountBacking();
    ColuAccount account;
    if (accountKey == null) {
      account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,singleAddressAccount.getAddress(),exchangeRateManager,handler,eventBus,logger,coluAsset);
    }
 else {
      account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,accountKey,exchangeRateManager,handler,eventBus,logger,coluAsset);
    }
    coluAccounts.put(account.getId(),account);
    loadSingleAddressAccounts();
    account.setLabel(metadataStorage.getLabelByAccount(account.getId()));
  }
 catch (  InvalidKeyCipher e) {
    Log.e(TAG,e.toString());
  }
}

Fixed version (ground truth):
private void loadColuAccount(ColuAccount.ColuAsset coluAsset,UUID uuid){
  try {
    Log.d(TAG,"String_Node_Str" + uuid.toString());
    CreatedAccountInfo createdAccountInfo=new CreatedAccountInfo();
    SingleAddressAccount singleAddressAccount;
    if (!_walletAccounts.containsKey(uuid))     return;
    createdAccountInfo.id=uuid;
    singleAddressAccount=(SingleAddressAccount)_walletAccounts.get(createdAccountInfo.id);
    InMemoryPrivateKey accountKey=singleAddressAccount.getPrivateKey(AesKeyCipher.defaultKeyCipher());
    createdAccountInfo.accountBacking=singleAddressAccount.getAccountBacking();
    ColuAccount account;
    if (accountKey == null) {
      account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,singleAddressAccount.getAddress(),exchangeRateManager,handler,eventBus,logger,coluAsset);
    }
 else {
      account=new ColuAccount(ColuManager.this,createdAccountInfo.accountBacking,metadataStorage,accountKey,exchangeRateManager,coluAsset);
    }
    coluAccounts.put(account.getId(),account);
    loadSingleAddressAccounts();
    account.setLabel(metadataStorage.getLabelByAccount(account.getId()));
  }
 catch (  InvalidKeyCipher e) {
    Log.e(TAG,e.toString());
  }
}
Program: 91168
Project: 91168
Buggy source:
private void archive(final WalletAccount account){
  AlertDialog.Builder confirmDialog=new AlertDialog.Builder(getActivity());
  confirmDialog.setTitle(R.string.archiving_account_title);
  confirmDialog.setMessage(getString(R.string.question_archive_account));
  confirmDialog.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
      account.archiveAccount();
      _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
      _mbwManager.getEventBus().post(new AccountChanged(account.getId()));
      updateIncludingMenus();
      _toaster.toast(R.string.archived,false);
    }
  }
);
  confirmDialog.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
    }
  }
);
  confirmDialog.show();
}

Fixed version (ground truth):
private void archive(final WalletAccount account){
  AlertDialog.Builder confirmDialog=new AlertDialog.Builder(getActivity());
  confirmDialog.setTitle(R.string.archiving_account_title);
  confirmDialog.setMessage(getString(R.string.question_archive_account));
  confirmDialog.setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
      account.archiveAccount();
      WalletAccount linkedAccount=Utils.getLinkedAccount(account,_mbwManager.getColuManager().getAccounts().values());
      if (linkedAccount != null) {
        linkedAccount.archiveAccount();
      }
      _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
      _mbwManager.getEventBus().post(new AccountChanged(account.getId()));
      updateIncludingMenus();
      _toaster.toast(R.string.archived,false);
    }
  }
);
  confirmDialog.setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
    }
  }
);
  confirmDialog.show();
}
Program: 91169
Project: 91169
Buggy source:
private void activate(WalletAccount account){
  account.activateAccount();
  _mbwManager.setSelectedAccount(account.getId());
  updateIncludingMenus();
  _toaster.toast(R.string.activated,false);
  _mbwManager.getWalletManager(false).startSynchronization();
}

Fixed version (ground truth):
private void activate(WalletAccount account){
  account.activateAccount();
  WalletAccount linkedAccount=Utils.getLinkedAccount(account,_mbwManager.getColuManager().getAccounts().values());
  if (linkedAccount != null) {
    linkedAccount.activateAccount();
  }
  _mbwManager.setSelectedAccount(account.getId());
  updateIncludingMenus();
  _toaster.toast(R.string.activated,false);
  _mbwManager.getWalletManager(false).startSynchronization();
}
Program: 91170
Project: 91170
Buggy source:
@Override public void archiveAccount(){
  archived=true;
  metadataStorage.storeArchived(uuid,true);
}

Fixed version (ground truth):
@Override public void archiveAccount(){
  archived=true;
  metadataStorage.storeArchived(uuid,true);
  linkedAccount.archiveAccount();
}
Program: 91171
Project: 91171
Buggy source:
@Override protected boolean doSynchronization(SyncMode mode){
  try {
    manager.updateAccountBalance(this);
    if (linkedAccount != null) {
      linkedAccount.doSynchronization(SyncMode.NORMAL);
    }
  }
 catch (  IOException e) {
    Optional<String> balance=manager.getColuBalance(this.uuid);
    if (balance.isPresent()) {
      ExactCurrencyValue confirmed=ExactCurrencyValue.from(new BigDecimal(balance.get()),getColuAsset().name);
      setBalanceFiat(new CurrencyBasedBalance(confirmed,ExactCurrencyValue.from(BigDecimal.ZERO,getColuAsset().name),ExactCurrencyValue.from(BigDecimal.ZERO,getColuAsset().name)));
    }
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean doSynchronization(SyncMode mode){
  try {
    manager.updateAccountBalance(this);
    if (linkedAccount != null) {
      if (linkedAccount.isArchived()) {
        linkedAccount.activateAccount();
      }
      linkedAccount.doSynchronization(SyncMode.NORMAL);
    }
  }
 catch (  IOException e) {
    Optional<String> balance=manager.getColuBalance(this.uuid);
    if (balance.isPresent()) {
      ExactCurrencyValue confirmed=ExactCurrencyValue.from(new BigDecimal(balance.get()),getColuAsset().name);
      setBalanceFiat(new CurrencyBasedBalance(confirmed,ExactCurrencyValue.from(BigDecimal.ZERO,getColuAsset().name),ExactCurrencyValue.from(BigDecimal.ZERO,getColuAsset().name)));
    }
  }
  return true;
}
Program: 91172
Project: 91172
Buggy source:
@Override public void activateAccount(){
  archived=false;
  metadataStorage.storeArchived(uuid,false);
}

Fixed version (ground truth):
@Override public void activateAccount(){
  archived=false;
  metadataStorage.storeArchived(uuid,false);
  linkedAccount.activateAccount();
}
Program: 91173
Project: 91173
Buggy source:
public synchronized CurrencyValue getSumAsCurrency(String targetCurrency,ExchangeRateProvider exchangeRateProvider){
  CurrencyValue sum=ExactCurrencyValue.from(BigDecimal.ZERO,targetCurrency);
  for (  Map.Entry<String,CurrencyValue> value : buckets.entrySet()) {
    if (value.getValue() != null) {
      sum=sum.add(value.getValue(),exchangeRateProvider);
    }
  }
  return sum;
}

Fixed version (ground truth):
public synchronized CurrencyValue getSumAsCurrency(String targetCurrency,ExchangeRateProvider exchangeRateProvider){
  CurrencyValue sum=ExactCurrencyValue.from(BigDecimal.ZERO,targetCurrency);
  for (  Map.Entry<String,CurrencyValue> value : buckets.entrySet()) {
    if (value.getValue() != null) {
      CurrencyValue sumLocal=sum.add(value.getValue(),exchangeRateProvider);
      if (sumLocal.getValue() != null) {
        sum=sumLocal;
      }
    }
  }
  return sum;
}
Program: 91174
Project: 91174
Buggy source:
/** 
 * @param minerFeePerKbToUse Determines the dust level, at which including a UTXO costs more than it is worth.
 * @return all UTXOs that are spendable now, as they are neither locked coinbase outputs nor unconfirmed received coins if _allowZeroConfSpending is not set nor dust.
 */
protected Collection<TransactionOutputEx> getSpendableOutputs(long minerFeePerKbToUse){
  long satDustOutput=StandardTransactionBuilder.MAX_INPUT_SIZE * minerFeePerKbToUse / 1000;
  Collection<TransactionOutputEx> allUnspentOutputs=_backing.getAllUnspentOutputs();
  int blockChainHeight=getBlockChainHeight();
  Iterator<TransactionOutputEx> it=allUnspentOutputs.iterator();
  while (it.hasNext()) {
    TransactionOutputEx output=it.next();
    if (output.value < satDustOutput || output.isCoinBase && blockChainHeight - output.height < COINBASE_MIN_CONFIRMATIONS || !_allowZeroConfSpending && output.height == -1 && !isFromMe(output.outPoint.hash)) {
      it.remove();
    }
 else {
      Transaction transaction=TransactionEx.toTransaction(_backing.getTransaction(output.outPoint.hash));
      for (int i=0; i < transaction.outputs.length; i++) {
        TransactionOutput curOutput=transaction.outputs[i];
        byte[] scriptBytes=curOutput.script.getScriptBytes();
        if (curOutput.value == 0 && scriptBytes.length >= 4 && scriptBytes[2] == 0x43 & scriptBytes[3] == 0x43) {
          it.remove();
          break;
        }
      }
    }
  }
  return allUnspentOutputs;
}

Fixed version (ground truth):
/** 
 * @param minerFeePerKbToUse Determines the dust level, at which including a UTXO costs more than it is worth.
 * @return all UTXOs that are spendable now, as they are neither locked coinbase outputs nor unconfirmed received coins if _allowZeroConfSpending is not set nor dust.
 */
protected Collection<TransactionOutputEx> getSpendableOutputs(long minerFeePerKbToUse){
  long satDustOutput=StandardTransactionBuilder.MAX_INPUT_SIZE * minerFeePerKbToUse / 1000;
  Collection<TransactionOutputEx> allUnspentOutputs=_backing.getAllUnspentOutputs();
  int blockChainHeight=getBlockChainHeight();
  Iterator<TransactionOutputEx> it=allUnspentOutputs.iterator();
  while (it.hasNext()) {
    TransactionOutputEx output=it.next();
    if (output.value < satDustOutput || output.isCoinBase && blockChainHeight - output.height < COINBASE_MIN_CONFIRMATIONS || !_allowZeroConfSpending && output.height == -1 && !isFromMe(output.outPoint.hash)) {
      it.remove();
    }
 else {
      Transaction transaction=TransactionEx.toTransaction(_backing.getTransaction(output.outPoint.hash));
      for (int i=0; i < transaction.outputs.length; i++) {
        TransactionOutput curOutput=transaction.outputs[i];
        byte[] scriptBytes=curOutput.script.getScriptBytes();
        if (curOutput.value == 0 && scriptBytes.length >= 4 && scriptBytes[2] == 0x43 && scriptBytes[3] == 0x43) {
          it.remove();
          break;
        }
      }
    }
  }
  return allUnspentOutputs;
}
Program: 91176
Project: 91176
Buggy source:
@Override protected void onPostExecute(ColuBroadcastTxHex.Json preparedTransaction){
  super.onPostExecute(preparedTransaction);
  Log.d(TAG,"String_Node_Str");
  if (preparedTransaction != null && !preparedTransaction.txHex.isEmpty()) {
    Log.d(TAG,"String_Node_Str" + preparedTransaction.txHex);
    _preparedColuTx=preparedTransaction;
    if (callback != null) {
      callback.success();
    }
    Toast.makeText(SendMainActivity.this,R.string.colu_succeeded_to_prepare,Toast.LENGTH_SHORT).show();
  }
 else {
    if (callback != null) {
      callback.fail();
    }
    Toast.makeText(SendMainActivity.this,getString(R.string.colu_failed_to_prepare),Toast.LENGTH_SHORT).show();
    updateUi();
  }
}

Fixed version (ground truth):
@Override protected void onPostExecute(ColuBroadcastTxHex.Json preparedTransaction){
  super.onPostExecute(preparedTransaction);
  Log.d(TAG,"String_Node_Str");
  if (preparedTransaction != null && !preparedTransaction.txHex.isEmpty()) {
    Log.d(TAG,"String_Node_Str" + preparedTransaction.txHex);
    _preparedColuTx=preparedTransaction;
    if (callback != null) {
      callback.success();
    }
  }
 else {
    if (callback != null) {
      callback.fail();
    }
    Toast.makeText(SendMainActivity.this,getString(R.string.colu_failed_to_prepare),Toast.LENGTH_SHORT).show();
    updateUi();
  }
}
Program: 91177
Project: 91177
Buggy source:
@Override public void onClick(View view){
  if (!Utils.isConnected(getActivity())) {
    new AlertDialog.Builder(getActivity()).setMessage(R.string.no_network_connection).setPositiveButton(R.string.button_ok,null).create().show();
  }
 else   if (Calendar.getInstance().before(Keys.getICOStart()) && !BuildConfig.DEBUG) {
    new AlertDialog.Builder(getActivity()).setMessage(R.string.ico_will_start).setPositiveButton(R.string.button_ok,null).create().show();
  }
 else {
    Utils.showOptionalMessage(getActivity(),R.string.mycelium_no_responaility_rmc,new Runnable(){
      @Override public void run(){
        startActivity(new Intent(getActivity(),RmcActivity.class));
      }
    }
);
  }
}

Fixed version (ground truth):
@Override public void onClick(View view){
  Intent intent=new Intent(getActivity(),BuySellSelectFragment.class);
  startActivity(intent);
}
Program: 91178
Project: 91178
Buggy source:
private void updateUi(){
  View btBuySell=_root.findViewById(R.id.btBuySellBitcoin);
  WalletAccount account=Preconditions.checkNotNull(_mbwManager.getSelectedAccount());
  if (account instanceof ColuAccount) {
    btBuySell.setVisibility(View.GONE);
  }
 else {
    if (showButton) {
      btBuySell.setVisibility(View.VISIBLE);
      btBuySell.setOnClickListener(buySellOnClickListener);
    }
 else {
      btBuySell.setVisibility(View.GONE);
    }
  }
  View btBuySellRmc=_root.findViewById(R.id.btBuySellRMC);
  if (Calendar.getInstance().before(Keys.getICOEnd(getActivity()))) {
    btBuySellRmc.setOnClickListener(buySellRmcOnClickListener);
    _root.findViewById(R.id.btLearnMoreRMC).setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View view){
        try {
          startActivity(Intent.parseUri("String_Node_Str",0));
        }
 catch (        URISyntaxException e) {
          e.printStackTrace();
        }
      }
    }
);
  }
 else {
    btBuySellRmc.setVisibility(View.GONE);
    _root.findViewById(R.id.btLearnMoreRMC).setVisibility(View.GONE);
  }
  super.onResume();
}

Fixed version (ground truth):
private void updateUi(){
  View btBuySell=_root.findViewById(R.id.btBuySellBitcoin);
  WalletAccount account=Preconditions.checkNotNull(_mbwManager.getSelectedAccount());
  if (account instanceof ColuAccount) {
    btBuySell.setVisibility(View.GONE);
  }
 else {
    if (showButton) {
      btBuySell.setVisibility(View.VISIBLE);
      btBuySell.setOnClickListener(buySellOnClickListener);
    }
 else {
      btBuySell.setVisibility(View.GONE);
    }
  }
}