nus-yam/ex-repair huggingface dataset:
Program: 91088
Project: 91088
Buggy source:
public boolean removeUnusedBip44Account(Bip44Account account){
  if (account.hasHadActivity()) {
    return removedAccountIds;
  }
synchronized (_walletAccounts) {
    _bip44Accounts.remove(account);
    _walletAccounts.remove(account.getId());
    _backing.deleteBip44AccountContext(account.getId());
    removedAccountIds.add(last.getId());
    if (_btcToBchAccounts.containsKey(last.getId())) {
      _walletAccounts.remove(_btcToBchAccounts.get(last.getId()));
      removedAccountIds.add(_btcToBchAccounts.get(last.getId()));
      _btcToBchAccounts.remove(last.getId());
    }
    return removedAccountIds;
  }
}

Fixed version (ground truth):
public void removeUnusedBip44Account(Bip44Account account){
  if (account.hasHadActivity()) {
    return;
  }
synchronized (_walletAccounts) {
    _bip44Accounts.remove(account);
    _walletAccounts.remove(account.getId());
    _backing.deleteBip44AccountContext(account.getId());
    if (_btcToBchAccounts.containsKey(account.getId())) {
      _walletAccounts.remove(_btcToBchAccounts.get(account.getId()));
      _btcToBchAccounts.remove(account.getId());
    }
  }
}
Program: 91090
Project: 91090
Buggy source:
private CurrencySum getSpendableBalance(List<WalletAccount> walletAccountList){
  CurrencySum currencySum=new CurrencySum();
  for (  WalletAccount account : walletAccountList) {
    currencySum.add(account.getCurrencyBasedBalance().confirmed);
  }
  return currencySum;
}

Fixed version (ground truth):
private CurrencySum getSpendableBalance(List<WalletAccount> walletAccountList){
  CurrencySum currencySum=new CurrencySum();
  for (  WalletAccount account : walletAccountList) {
    if (!account.isArchived()) {
      currencySum.add(account.getCurrencyBasedBalance().confirmed);
    }
  }
  return currencySum;
}
Program: 91091
Project: 91091
Buggy source:
private void Denomination(int decimalPlaces,String asciiString,String unicodeString,BigDecimal oneUnitInSatoshis){
  _decimalPlaces=decimalPlaces;
  _asciiString=asciiString;
  _unicodeString=unicodeString;
  _oneUnitInSatoshis=oneUnitInSatoshis;
}

Fixed version (ground truth):
void Denomination(int decimalPlaces,String asciiString,String unicodeString,BigDecimal oneUnitInSatoshis){
  _decimalPlaces=decimalPlaces;
  _asciiString=asciiString;
  _unicodeString=unicodeString;
  _oneUnitInSatoshis=oneUnitInSatoshis;
}
Program: 91092
Project: 91092
Buggy source:
public static String valueString(long value,Denomination denomination,int precision){
  BigDecimal d=BigDecimal.valueOf(value);
  d=d.divide(denomination.getOneUnitInSatoshis());
  if (!formatCache.containsKey(precision)) {
    DecimalFormat coinFormat=(DecimalFormat)COIN_FORMAT.clone();
    coinFormat.setMaximumFractionDigits(precision);
    formatCache.put(precision,coinFormat);
  }
  return formatCache.get(precision).format(d);
}

Fixed version (ground truth):
/** 
 * Get the given value in satoshis as a string on the form "10.12345" using the specified denomination. <p> This method only returns necessary decimal points to tell the exact value. If you wish to display all digits use  {@link CoinUtil#fullValueString(long,Denomination)}
 * @param value The number of satoshis
 * @param denomination The denomination to use
 * @param precision max number of digits after the comma
 * @return The given value in satoshis as a string on the form "10.12345".
 */
public static String valueString(long value,Denomination denomination,int precision){
  BigDecimal d=BigDecimal.valueOf(value);
  d=d.divide(denomination.getOneUnitInSatoshis());
  if (!formatCache.containsKey(precision)) {
    DecimalFormat coinFormat=(DecimalFormat)COIN_FORMAT.clone();
    coinFormat.setMaximumFractionDigits(precision);
    formatCache.put(precision,coinFormat);
  }
  return formatCache.get(precision).format(d);
}
Program: 91093
Project: 91093
Buggy source:
public static Denomination fromString(String string){
  if (string == null) {
    return BTC;
  }
  if (string.equals("String_Node_Str")) {
    return BTC;
  }
 else   if (string.equals("String_Node_Str")) {
    return mBTC;
  }
 else   if (string.equals("String_Node_Str")) {
    return uBTC;
  }
 else   if (string.equals("String_Node_Str")) {
    return BITS;
  }
 else {
    return BTC;
  }
}

Fixed version (ground truth):
public static Denomination fromString(String string){
  if (string == null) {
    return BTC;
  }
switch (string) {
case "String_Node_Str":
    return BTC;
case "String_Node_Str":
  return mBTC;
case "String_Node_Str":
return uBTC;
case "String_Node_Str":
return BITS;
default :
return BTC;
}
}
Program: 91094
Project: 91094
Buggy source:
protected void shareByNfc(){
  NfcAdapter nfc=NfcAdapter.getDefaultAdapter(this);
  if (nfc != null && nfc.isNdefPushEnabled()) {
    nfc.setNdefPushMessageCallback(new NfcAdapter.CreateNdefMessageCallback(){
      @Override public NdefMessage createNdefMessage(      NfcEvent event){
        NdefRecord uriRecord=NdefRecord.createUri(getPaymentUri());
        return new NdefMessage(new NdefRecord[]{uriRecord});
      }
    }
,this);
    ivNfc.setVisibility(View.VISIBLE);
    ivNfc.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Utils.showSimpleMessageDialog(ReceiveCoinsActivity.this,getString(R.string.nfc_payment_request_hint));
      }
    }
);
  }
 else {
    ivNfc.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
protected void shareByNfc(){
  NfcAdapter nfc=NfcAdapter.getDefaultAdapter(this);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN && nfc != null && nfc.isNdefPushEnabled()) {
    nfc.setNdefPushMessageCallback(new NfcAdapter.CreateNdefMessageCallback(){
      @Override public NdefMessage createNdefMessage(      NfcEvent event){
        NdefRecord uriRecord=NdefRecord.createUri(getPaymentUri());
        return new NdefMessage(new NdefRecord[]{uriRecord});
      }
    }
,this);
    ivNfc.setVisibility(View.VISIBLE);
    ivNfc.setOnClickListener(new OnClickListener(){
      @Override public void onClick(      View v){
        Utils.showSimpleMessageDialog(ReceiveCoinsActivity.this,getString(R.string.nfc_payment_request_hint));
      }
    }
);
  }
 else {
    ivNfc.setVisibility(View.GONE);
  }
}
Program: 91095
Project: 91095
Buggy source:
@OnClick(R.id.btEnterAmount) public void onEnterClick(){
  if (CurrencyValue.isNullOrZero(_amount)) {
    GetAmountActivity.callMe(ReceiveCoinsActivity.this,ExactCurrencyValue.from(null,_mbwManager.getSelectedAccount().getAccountDefaultCurrency()),GET_AMOUNT_RESULT_CODE);
  }
 else {
    GetAmountActivity.callMe(ReceiveCoinsActivity.this,_amount.getExactValueIfPossible(),GET_AMOUNT_RESULT_CODE);
  }
}

Fixed version (ground truth):
@OnClick(R.id.btEnterAmount) public void onEnterClick(){
  if (CurrencyValue.isNullOrZero(_amount)) {
    GetAmountActivity.callMeToReceive(this,ExactCurrencyValue.from(null,_mbwManager.getSelectedAccount().getAccountDefaultCurrency()),GET_AMOUNT_RESULT_CODE);
  }
 else {
    GetAmountActivity.callMeToReceive(this,_amount.getExactValueIfPossible(),GET_AMOUNT_RESULT_CODE);
  }
}
Program: 91096
Project: 91096
Buggy source:
@OnClick(R.id.btEnterAmount) void onClickAmount(){
  CurrencyValue presetAmount=_amountToSend;
  if (CurrencyValue.isNullOrZero(presetAmount)) {
    presetAmount=ExactCurrencyValue.from(null,_account.getAccountDefaultCurrency());
  }
  GetAmountActivity.callMe(this,GET_AMOUNT_RESULT_CODE,_account.getId(),presetAmount,feePerKbValue,_isColdStorage);
}

Fixed version (ground truth):
@OnClick(R.id.btEnterAmount) void onClickAmount(){
  CurrencyValue presetAmount=_amountToSend;
  if (CurrencyValue.isNullOrZero(presetAmount)) {
    presetAmount=ExactCurrencyValue.from(null,_account.getAccountDefaultCurrency());
  }
  GetAmountActivity.callMeToSend(this,GET_AMOUNT_RESULT_CODE,_account.getId(),presetAmount,feePerKbValue,_isColdStorage);
}
Program: 91098
Project: 91098
Buggy source:
public static String getFormattedValue(CurrencyValue value,CoinUtil.Denomination denomination,int precision){
  if (value == null) {
    return "String_Node_Str";
  }
  BigDecimal val=value.getValue();
  if (val == null) {
    return "String_Node_Str";
  }
  if (value.isBtc()) {
    return CoinUtil.valueString(((BitcoinValue)value).getLongValue(),denomination,precision);
  }
 else {
    if (!formatCache.containsKey(precision)) {
      DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
      fiatFormat.setMaximumFractionDigits(precision);
      formatCache.put(precision,fiatFormat);
    }
    return formatCache.get(precision).format(val);
  }
}

Fixed version (ground truth):
public static String getFormattedValue(CurrencyValue value,CoinUtil.Denomination denomination,int precision){
  if (value == null) {
    return "String_Node_Str";
  }
  BigDecimal val=value.getValue();
  if (val == null) {
    return "String_Node_Str";
  }
  if (value.isBtc()) {
    return CoinUtil.valueString(((BitcoinValue)value).getLongValue(),denomination,precision);
  }
 else {
    if (formatCache.get(precision) == null) {
      DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
      fiatFormat.setMaximumFractionDigits(precision);
      formatCache.put(precision,fiatFormat);
    }
    return formatCache.get(precision).format(val);
  }
}
Program: 91099
Project: 91099
Buggy source:
public static Bitmap getMinimalQRCodeBitmap(String url){
  Hashtable<EncodeHintType,Object> hints=new Hashtable<EncodeHintType,Object>();
  hints.put(EncodeHintType.ERROR_CORRECTION,ErrorCorrectionLevel.M);
  hints.put(EncodeHintType.MARGIN,5);
  try {
    final BitMatrix result=new QRCodeWriter().encode(url,BarcodeFormat.QR_CODE,0,0,hints);
    final int width=result.getWidth();
    final int height=result.getHeight();
    final int[] pixels=new int[width * height];
    for (int y=0; y < height; y++) {
      final int offset=y * width;
      for (int x=0; x < width; x++) {
        pixels[offset + x]=result.get(x,y) ? Color.BLACK : Color.WHITE;
      }
    }
    final Bitmap smallBitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
    smallBitmap.setPixels(pixels,0,width,0,0,width,height);
    return smallBitmap;
  }
 catch (  final WriterException x) {
    x.printStackTrace();
    return null;
  }
}

Fixed version (ground truth):
public static Bitmap getMinimalQRCodeBitmap(String url){
  Hashtable<EncodeHintType,Object> hints=new Hashtable<>();
  hints.put(EncodeHintType.ERROR_CORRECTION,ErrorCorrectionLevel.M);
  hints.put(EncodeHintType.MARGIN,5);
  try {
    final BitMatrix result=new QRCodeWriter().encode(url,BarcodeFormat.QR_CODE,0,0,hints);
    final int width=result.getWidth();
    final int height=result.getHeight();
    final int[] pixels=new int[width * height];
    for (int y=0; y < height; y++) {
      final int offset=y * width;
      for (int x=0; x < width; x++) {
        pixels[offset + x]=result.get(x,y) ? Color.BLACK : Color.WHITE;
      }
    }
    final Bitmap smallBitmap=Bitmap.createBitmap(width,height,Bitmap.Config.ARGB_8888);
    smallBitmap.setPixels(pixels,0,width,0,0,width,height);
    return smallBitmap;
  }
 catch (  final WriterException x) {
    x.printStackTrace();
    return null;
  }
}
Program: 91100
Project: 91100
Buggy source:
public static String getFiatValueAsString(long satoshis,Double oneBtcInFiat,int precision){
  Double converted=getFiatValue(satoshis,oneBtcInFiat);
  if (converted == null) {
    return null;
  }
  if (!formatCache.containsKey(precision)) {
    DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
    fiatFormat.setMaximumFractionDigits(precision);
    formatCache.put(precision,fiatFormat);
  }
  return formatCache.get(precision).format(converted);
}

Fixed version (ground truth):
public static String getFiatValueAsString(long satoshis,Double oneBtcInFiat,int precision){
  Double converted=getFiatValue(satoshis,oneBtcInFiat);
  if (converted == null) {
    return null;
  }
  if (formatCache.get(precision) == null) {
    DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
    fiatFormat.setMaximumFractionDigits(precision);
    formatCache.put(precision,fiatFormat);
  }
  return formatCache.get(precision).format(converted);
}
Program: 91101
Project: 91101
Buggy source:
public static String getFormattedValueWithUnit(CurrencyValue value,CoinUtil.Denomination denomination,int precision){
  if (value == null) {
    return "String_Node_Str";
  }
  BigDecimal val=value.getValue();
  if (val == null) {
    return "String_Node_Str";
  }
  if (value.isBtc()) {
    return String.format("String_Node_Str",CoinUtil.valueString(((BitcoinValue)value).getLongValue(),denomination,precision),denomination.getUnicodeName());
  }
 else {
    if (!formatCache.containsKey(precision)) {
      DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
      fiatFormat.setMaximumFractionDigits(precision);
      formatCache.put(precision,fiatFormat);
    }
    return String.format("String_Node_Str",formatCache.get(precision).format(val),value.getCurrency());
  }
}

Fixed version (ground truth):
public static String getFormattedValueWithUnit(CurrencyValue value,CoinUtil.Denomination denomination,int precision){
  if (value == null) {
    return "String_Node_Str";
  }
  BigDecimal val=value.getValue();
  if (val == null) {
    return "String_Node_Str";
  }
  if (value.isBtc()) {
    return String.format("String_Node_Str",CoinUtil.valueString(((BitcoinValue)value).getLongValue(),denomination,precision),denomination.getUnicodeName());
  }
 else {
    if (formatCache.get(precision) == null) {
      DecimalFormat fiatFormat=(DecimalFormat)FIAT_FORMAT.clone();
      fiatFormat.setMaximumFractionDigits(precision);
      formatCache.put(precision,fiatFormat);
    }
    return String.format("String_Node_Str",formatCache.get(precision).format(val),value.getCurrency());
  }
}
Program: 91103
Project: 91103
Buggy source:
/** 
 * Show a dialog with a buttons that displays a message. Click the message or the back button to make it disappear.
 */
public static void showSimpleMessageDialog(final Context context,String message,final Runnable okayRunner,@StringRes int okayButtonText,final Runnable postRunner){
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  final View layout=inflater.inflate(R.layout.simple_message_dialog,null);
  AlertDialog.Builder builder=new AlertDialog.Builder(context).setView(layout);
  final AlertDialog dialog=builder.create();
  TextView tvMessage=((TextView)layout.findViewById(R.id.tvMessage));
  tvMessage.setText(message);
  TextView okButton=(TextView)layout.findViewById(R.id.btOk);
  okButton.setText(okayButtonText);
  okButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      dialog.dismiss();
      if (okayRunner != null) {
        okayRunner.run();
      }
    }
  }
);
  dialog.setOnDismissListener(new DialogInterface.OnDismissListener(){
    @Override public void onDismiss(    DialogInterface dialog){
      if (postRunner != null) {
        postRunner.run();
      }
    }
  }
);
  dialog.show();
}

Fixed version (ground truth):
/** 
 * Show a dialog with a buttons that displays a message. Click the message or the back button to make it disappear.
 */
public static void showSimpleMessageDialog(final Context context,String message,final Runnable okayRunner,@StringRes int okayButtonText,final Runnable postRunner){
  LayoutInflater inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  final View layout=inflater.inflate(R.layout.simple_message_dialog,null);
  AlertDialog.Builder builder=new AlertDialog.Builder(context).setView(layout);
  final AlertDialog dialog=builder.create();
  TextView tvMessage=layout.findViewById(R.id.tvMessage);
  tvMessage.setText(message);
  TextView okButton=layout.findViewById(R.id.btOk);
  okButton.setText(okayButtonText);
  okButton.setOnClickListener(new OnClickListener(){
    @Override public void onClick(    View v){
      dialog.dismiss();
      if (okayRunner != null) {
        okayRunner.run();
      }
    }
  }
);
  dialog.setOnDismissListener(new DialogInterface.OnDismissListener(){
    @Override public void onDismiss(    DialogInterface dialog){
      if (postRunner != null) {
        postRunner.run();
      }
    }
  }
);
  dialog.show();
}
Program: 91104
Project: 91104
Buggy source:
private boolean synchronize(){
  if (_spvBalanceFetcher != null) {
    if (currentAccount instanceof Bip44BCHAccount) {
      _spvBalanceFetcher.requestTransactionsAsync(((Bip44BCHAccount)currentAccount).getAccountIndex());
    }
    if (currentAccount instanceof SingleAddressBCHAccount) {
      _spvBalanceFetcher.requestTransactionsFromSingleAddressAccountAsync(currentAccount.getId().toString());
    }
    for (    WalletAccount account : getAllAccounts()) {
      if (account instanceof Bip44Account) {
      }
 else {
        if (!account.isArchived()) {
          if (!account.synchronize(syncMode)) {
            return false;
          }
        }
      }
    }
  }
 else {
    if (syncMode.onlyActiveAccount) {
      if (currentAccount != null && !currentAccount.isArchived()) {
        return currentAccount.synchronize(syncMode);
      }
    }
 else {
      for (      WalletAccount account : getAllAccounts()) {
        if (!account.isArchived()) {
          if (!account.synchronize(syncMode)) {
            return false;
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
private boolean synchronize(){
  if (_spvBalanceFetcher != null) {
    if (currentAccount instanceof Bip44BCHAccount) {
      _spvBalanceFetcher.requestTransactionsAsync(((Bip44BCHAccount)currentAccount).getAccountIndex());
    }
    if (currentAccount instanceof SingleAddressBCHAccount) {
      _spvBalanceFetcher.requestTransactionsFromSingleAddressAccountAsync(currentAccount.getId().toString());
    }
    for (    WalletAccount account : getAllAccounts()) {
      if (account instanceof Bip44Account) {
      }
 else {
        if (!account.isArchived()) {
          if (!account.synchronize(syncMode)) {
            return false;
          }
        }
      }
    }
  }
  if (syncMode.onlyActiveAccount) {
    if (currentAccount != null && !currentAccount.isArchived() && !(currentAccount instanceof Bip44BCHAccount || currentAccount instanceof SingleAddressBCHAccount)) {
      return currentAccount.synchronize(syncMode);
    }
  }
 else {
    for (    WalletAccount account : getAllAccounts()) {
      if (account.isArchived() || account instanceof Bip44BCHAccount || account instanceof SingleAddressBCHAccount) {
        continue;
      }
      if (!account.synchronize(syncMode)) {
        return false;
      }
    }
  }
  return true;
}
Program: 91105
Project: 91105
Buggy source:
private SpvBalanceFetcher getSpvBchFetcher(){
  SpvBalanceFetcher result=null;
  if (CommunicationManager.getInstance(_applicationContext).getPairedModules().contains(GooglePlayModuleCollection.INSTANCE.getModules(_applicationContext).get("String_Node_Str"))) {
    result=new SpvBchFetcher(_applicationContext);
  }
  return result;
}

Fixed version (ground truth):
private SpvBalanceFetcher getSpvBchFetcher(){
  SpvBalanceFetcher result=null;
  if (CommunicationManager.getInstance(_applicationContext).getPairedModules().contains(GooglePlayModuleCollection.getModules(_applicationContext).get("String_Node_Str"))) {
    result=new SpvBchFetcher(_applicationContext);
  }
  return result;
}
Program: 91106
Project: 91106
Buggy source:
public static String formatFiatWithUnit(CurrencyValue fiat){
  return FIAT_FORMAT.format(fiat.getValue()) + "String_Node_Str" + fiat.getCurrency();
}

Fixed version (ground truth):
public static String formatFiatWithUnit(CurrencyValue fiat){
  try {
    return FIAT_FORMAT.format(fiat.getValue()) + "String_Node_Str" + fiat.getCurrency();
  }
 catch (  Exception e) {
    Log.e(TAG,e.getMessage());
    return "String_Node_Str";
  }
}
Program: 91107
Project: 91107
Buggy source:
@Override public void onClick(View v){
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      _mbwManager.setKeyManagementLocked(false);
      update();
      if (isAdded()) {
        getActivity().supportInvalidateOptionsMenu();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onClick(View v){
  _mbwManager.runPinProtectedFunction(AccountsFragment.this.getActivity(),new Runnable(){
    @Override public void run(){
      _mbwManager.setKeyManagementLocked(false);
      update();
      if (isAdded()) {
        getActivity().invalidateOptionsMenu();
      }
    }
  }
);
}
Program: 91108
Project: 91108
Buggy source:
@Override public void run(){
  _mbwManager.setKeyManagementLocked(false);
  update();
  if (isAdded()) {
    getActivity().supportInvalidateOptionsMenu();
  }
}

Fixed version (ground truth):
@Override public void run(){
  _mbwManager.setKeyManagementLocked(false);
  update();
  if (isAdded()) {
    getActivity().invalidateOptionsMenu();
  }
}
Program: 91109
Project: 91109
Buggy source:
private void lock(){
  _mbwManager.setKeyManagementLocked(true);
  update();
  if (isAdded()) {
    getActivity().supportInvalidateOptionsMenu();
  }
}

Fixed version (ground truth):
private void lock(){
  _mbwManager.setKeyManagementLocked(true);
  update();
  if (isAdded()) {
    getActivity().invalidateOptionsMenu();
  }
}
Program: 91111
Project: 91111
Buggy source:
private CurrencyValue getPotentialBalanceColu(WalletAccount account){
  if (account.isArchived()) {
    return null;
  }
 else {
    CurrencyBasedBalance balance=account.getCurrencyBasedBalance();
    ExchangeRateManager exchanger=_mbwManager.getExchangeRateManager();
    return balance.confirmed;
  }
}

Fixed version (ground truth):
private CurrencyValue getPotentialBalanceColu(WalletAccount account){
  if (account.isArchived()) {
    return null;
  }
 else {
    CurrencyBasedBalance balance=account.getCurrencyBasedBalance();
    return balance.confirmed;
  }
}
Program: 91112
Project: 91112
Buggy source:
/** 
 * 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);
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 */
@SuppressWarnings("String_Node_Str") @Override public View onCreateView(@NonNull LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.records_activity,container,false);
}
Program: 91113
Project: 91113
Buggy source:
@Override public void onViewCreated(View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  rvRecords=(RecyclerView)view.findViewById(R.id.rvRecords);
  rvRecords.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
  accountListAdapter=new AccountListAdapter(getActivity(),_mbwManager);
  rvRecords.setAdapter(accountListAdapter);
  rvRecords.addItemDecoration(new DividerItemDecoration(getResources().getDrawable(R.drawable.divider_account_list)));
  rvRecords.setHasFixedSize(true);
  llLocked=view.findViewById(R.id.llLocked);
  accountListAdapter.setItemClickListener(recordAddressClickListener);
  accountListAdapter.setItemSelectListener(recordStarClickListener);
}

Fixed version (ground truth):
@Override public void onViewCreated(@NonNull View view,@Nullable Bundle savedInstanceState){
  super.onViewCreated(view,savedInstanceState);
  rvRecords=(RecyclerView)view.findViewById(R.id.rvRecords);
  rvRecords.setLayoutManager(new LinearLayoutManager(getActivity(),LinearLayoutManager.VERTICAL,false));
  accountListAdapter=new AccountListAdapter(getActivity(),_mbwManager);
  rvRecords.setAdapter(accountListAdapter);
  rvRecords.addItemDecoration(new DividerItemDecoration(getResources().getDrawable(R.drawable.divider_account_list)));
  rvRecords.setHasFixedSize(true);
  llLocked=view.findViewById(R.id.llLocked);
  accountListAdapter.setItemClickListener(recordAddressClickListener);
  accountListAdapter.setItemSelectListener(recordStarClickListener);
}
Program: 91115
Project: 91115
Buggy source:
@Override protected WalletAccount.BroadcastResult doInBackground(Void... args){
  if (CommunicationManager.getInstance(getApplicationContext()).getPairedModules().contains(GooglePlayModuleCollection.INSTANCE.getModules(getApplicationContext()).get("String_Node_Str"))) {
    Intent intent=IntentContract.BroadcastTransaction.createIntent(_transaction.toBytes());
    WalletApplication.sendToSpv(intent,_mbwManager.getSelectedAccount().getType());
    return WalletAccount.BroadcastResult.SUCCESS;
  }
  return _account.broadcastTransaction(_transaction);
}

Fixed version (ground truth):
@Override protected WalletAccount.BroadcastResult doInBackground(Void... args){
  if (CommunicationManager.getInstance(getApplicationContext()).getPairedModules().contains(GooglePlayModuleCollection.getModules(getApplicationContext()).get("String_Node_Str"))) {
    Intent intent=IntentContract.BroadcastTransaction.createIntent(_transaction.toBytes());
    WalletApplication.sendToSpv(intent,_mbwManager.getSelectedAccount().getType());
    return WalletAccount.BroadcastResult.SUCCESS;
  }
  return _account.broadcastTransaction(_transaction);
}
Program: 91116
Project: 91116
Buggy source:
private AsyncTask<Void,Integer,WalletAccount.BroadcastResult> startBroadcastingTask(){
  AsyncTask<Void,Integer,WalletAccount.BroadcastResult> task=new AsyncTask<Void,Integer,WalletAccount.BroadcastResult>(){
    @Override protected WalletAccount.BroadcastResult doInBackground(    Void... args){
      if (CommunicationManager.getInstance(getApplicationContext()).getPairedModules().contains(GooglePlayModuleCollection.INSTANCE.getModules(getApplicationContext()).get("String_Node_Str"))) {
        Intent intent=IntentContract.BroadcastTransaction.createIntent(_transaction.toBytes());
        WalletApplication.sendToSpv(intent,_mbwManager.getSelectedAccount().getType());
        return WalletAccount.BroadcastResult.SUCCESS;
      }
      return _account.broadcastTransaction(_transaction);
    }
    @Override protected void onPostExecute(    WalletAccount.BroadcastResult result){
      _broadcastResult=result;
      showResult();
    }
  }
;
  task.execute();
  return task;
}

Fixed version (ground truth):
private AsyncTask<Void,Integer,WalletAccount.BroadcastResult> startBroadcastingTask(){
  AsyncTask<Void,Integer,WalletAccount.BroadcastResult> task=new AsyncTask<Void,Integer,WalletAccount.BroadcastResult>(){
    @Override protected WalletAccount.BroadcastResult doInBackground(    Void... args){
      if (CommunicationManager.getInstance(getApplicationContext()).getPairedModules().contains(GooglePlayModuleCollection.getModules(getApplicationContext()).get("String_Node_Str"))) {
        Intent intent=IntentContract.BroadcastTransaction.createIntent(_transaction.toBytes());
        WalletApplication.sendToSpv(intent,_mbwManager.getSelectedAccount().getType());
        return WalletAccount.BroadcastResult.SUCCESS;
      }
      return _account.broadcastTransaction(_transaction);
    }
    @Override protected void onPostExecute(    WalletAccount.BroadcastResult result){
      _broadcastResult=result;
      showResult();
    }
  }
;
  task.execute();
  return task;
}
Program: 91119
Project: 91119
Buggy source:
private void setLayout(ChangellyUITypes uiType){
  findViewById(R.id.llChangellyValidationWait).setVisibility(View.GONE);
  findViewById(R.id.llChangellyLoadingProgress).setVisibility(View.GONE);
  findViewById(R.id.llChangellyErrorWrapper).setVisibility(View.GONE);
  findViewById(R.id.llChangellyMain).setVisibility(View.GONE);
switch (uiType) {
case Loading:
    findViewById(R.id.llChangellyValidationWait).setVisibility(View.VISIBLE);
  break;
case RetryLater:
findViewById(R.id.llChangellyErrorWrapper).setVisibility(View.VISIBLE);
case Main:
findViewById(R.id.llChangellyMain).setVisibility(View.VISIBLE);
}
}

Fixed version (ground truth):
private void setLayout(ChangellyUITypes uiType){
  llChangellyValidationWait.setVisibility(View.GONE);
  llChangellyLoadingProgress.setVisibility(View.GONE);
  llChangellyErrorWrapper.setVisibility(View.GONE);
  llChangellyMain.setVisibility(View.GONE);
switch (uiType) {
case Loading:
    llChangellyValidationWait.setVisibility(View.VISIBLE);
  break;
case RetryLater:
llChangellyErrorWrapper.setVisibility(View.VISIBLE);
case Main:
llChangellyMain.setVisibility(View.VISIBLE);
}
}
Program: 91120
Project: 91120
Buggy source:
@OnClick(R.id.buttonContinue) void createAndSignTransaction(){
  long fromValue=ExactBitcoinCashValue.from(BigDecimal.valueOf(offer.amountFrom)).getLongValue();
  try {
    StandardTransactionBuilder.UnsignedTransaction unsignedTransaction=fromAccount.createUnsignedTransaction(Arrays.asList(new WalletAccount.Receiver(Address.fromString(offer.payinAddress),fromValue)),MINER_FEE);
    Transaction transaction=fromAccount.signTransaction(unsignedTransaction,AesKeyCipher.defaultKeyCipher());
    WalletAccount account=mbwManager.getSelectedAccount();
    Intent intent=IntentContract.BroadcastTransaction.createIntent(transaction.toBytes());
    WalletApplication.sendToSpv(intent,account.getType());
  }
 catch (  UnableToBuildTransactionException|InsufficientFundsException|OutputTooSmallException|KeyCipher.InvalidKeyCipher e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
@OnClick(R.id.buttonContinue) void createAndSignTransaction(){
  long fromValue=ExactBitcoinCashValue.from(BigDecimal.valueOf(offer.amountFrom)).getLongValue();
  try {
    StandardTransactionBuilder.UnsignedTransaction unsignedTransaction=fromAccount.createUnsignedTransaction(Collections.singletonList(new WalletAccount.Receiver(Address.fromString(offer.payinAddress),fromValue)),MINER_FEE);
    Transaction transaction=fromAccount.signTransaction(unsignedTransaction,AesKeyCipher.defaultKeyCipher());
    WalletAccount account=mbwManager.getSelectedAccount();
    Intent intent=IntentContract.BroadcastTransaction.createIntent(transaction.toBytes());
    WalletApplication.sendToSpv(intent,account.getType());
  }
 catch (  UnableToBuildTransactionException|InsufficientFundsException|OutputTooSmallException|KeyCipher.InvalidKeyCipher e) {
    e.printStackTrace();
  }
}
Program: 91122
Project: 91122
Buggy source:
@OnClick(R.id.toValueLayout) void toValueClick(){
  valueKeyboard.setInputTextView(toValue);
  valueKeyboard.setVisibility(View.VISIBLE);
  fromRecyclerView.setVisibility(View.GONE);
  toRecyclerView.setVisibility(View.GONE);
  toLayout.setAlpha(Constants.ACTIVE_ALPHA);
  fromLayout.setAlpha(Constants.INACTIVE_ALPHA);
  valueKeyboard.setMaxValue(BigDecimal.ZERO);
}

Fixed version (ground truth):
@OnClick(R.id.toValueLayout) void toValueClick(){
  valueKeyboard.setInputTextView(toValue);
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setEntry(toValue.getText().toString());
  fromRecyclerView.setVisibility(View.GONE);
  toRecyclerView.setVisibility(View.GONE);
  toLayout.setAlpha(Constants.ACTIVE_ALPHA);
  fromLayout.setAlpha(Constants.INACTIVE_ALPHA);
  valueKeyboard.setMaxValue(BigDecimal.ZERO);
}
Program: 91123
Project: 91123
Buggy source:
@OnClick(R.id.fromValueLayout) void fromValueClick(){
  valueKeyboard.setInputTextView(fromValue);
  valueKeyboard.setVisibility(View.VISIBLE);
  fromLayout.setAlpha(Constants.ACTIVE_ALPHA);
  toLayout.setAlpha(Constants.INACTIVE_ALPHA);
  AccountAdapter.Item item=fromAccountAdapter.getItem(fromRecyclerView.getSelectedItem());
  valueKeyboard.setMaxValue(getMaxSpend(item.account));
}

Fixed version (ground truth):
@OnClick(R.id.fromValueLayout) void fromValueClick(){
  valueKeyboard.setInputTextView(fromValue);
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setEntry(fromValue.getText().toString());
  fromLayout.setAlpha(Constants.ACTIVE_ALPHA);
  toLayout.setAlpha(Constants.INACTIVE_ALPHA);
  AccountAdapter.Item item=fromAccountAdapter.getItem(fromRecyclerView.getSelectedItem());
  valueKeyboard.setMaxValue(getMaxSpend(item.account));
}
Program: 91124
Project: 91124
Buggy source:
@Override public void onItemClick(WalletAccount account){
  if (!_mbwManager.getSelectedAccount().equals(account) && account.isActive()) {
    _mbwManager.setSelectedAccount(account.getId());
  }
  toastSelectedAccountChanged(account);
  updateIncludingMenus();
}

Fixed version (ground truth):
@Override public void onItemClick(WalletAccount account){
  if (!_mbwManager.getSelectedAccount().equals(account) && account.isActive()) {
    _mbwManager.setSelectedAccount(account.getId());
  }
  toastSelectedAccountChanged(account);
  accountListAdapter.setFocusedAccount(account);
  updateIncludingMenus();
}
Program: 91125
Project: 91125
Buggy source:
public static Transaction fromByteReader(ByteReader reader,Sha256Hash knownTransactionHash) throws TransactionParsingException {
  int size=reader.available();
  try {
    int version=reader.getIntLE();
    int numInputs=(int)reader.getCompactInt();
    TransactionInput[] inputs=new TransactionInput[numInputs];
    for (int i=0; i < numInputs; i++) {
      try {
        inputs[i]=TransactionInput.fromByteReader(reader);
      }
 catch (      TransactionInputParsingException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage(),e);
      }
catch (      IllegalStateException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage(),e);
      }
    }
    int numOutputs=(int)reader.getCompactInt();
    TransactionOutput[] outputs=new TransactionOutput[numOutputs];
    for (int i=0; i < numOutputs; i++) {
      try {
        outputs[i]=TransactionOutput.fromByteReader(reader);
      }
 catch (      TransactionOutputParsingException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage(),e);
      }
    }
    int lockTime=reader.getIntLE();
    return new Transaction(version,inputs,outputs,lockTime,size,knownTransactionHash);
  }
 catch (  InsufficientBytesException e) {
    throw new TransactionParsingException(e.getMessage());
  }
}

Fixed version (ground truth):
public static Transaction fromByteReader(ByteReader reader,Sha256Hash knownTransactionHash) throws TransactionParsingException {
  int size=reader.available();
  try {
    int version=reader.getIntLE();
    int numInputs=(int)reader.getCompactInt();
    TransactionInput[] inputs=new TransactionInput[numInputs];
    for (int i=0; i < numInputs; i++) {
      try {
        inputs[i]=TransactionInput.fromByteReader(reader);
      }
 catch (      TransactionInputParsingException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage(),e);
      }
catch (      IllegalStateException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage(),e);
      }
    }
    int numOutputs=(int)reader.getCompactInt();
    TransactionOutput[] outputs=new TransactionOutput[numOutputs];
    for (int i=0; i < numOutputs; i++) {
      try {
        outputs[i]=TransactionOutput.fromByteReader(reader);
      }
 catch (      TransactionOutputParsingException e) {
        throw new TransactionParsingException("String_Node_Str" + i + "String_Node_Str"+ e.getMessage());
      }
    }
    int lockTime=reader.getIntLE();
    return new Transaction(version,inputs,outputs,lockTime,size,knownTransactionHash);
  }
 catch (  InsufficientBytesException e) {
    throw new TransactionParsingException(e.getMessage());
  }
}
Program: 91128
Project: 91128
Buggy source:
@Override public void done(){
  currencySelector.setVisibility(View.VISIBLE);
  accountSelector.setVisibility(View.VISIBLE);
  titleView.setVisibility(View.VISIBLE);
  subtitleView.setVisibility(View.VISIBLE);
}

Fixed version (ground truth):
@Override public void done(){
  currencySelector.setVisibility(View.VISIBLE);
  accountSelector.setVisibility(View.VISIBLE);
  titleView.setVisibility(View.VISIBLE);
  subtitleView.setVisibility(View.VISIBLE);
  fromLayout.setAlpha(INACTIVE_ALPHA);
  toLayout.setAlpha(INACTIVE_ALPHA);
}
Program: 91129
Project: 91129
Buggy source:
@OnClick(R.id.toValue) void clickToValue(){
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setInputTextView(toValue);
  valueKeyboard.setEntry(toValue.getText().toString());
  currencySelector.setVisibility(View.GONE);
  accountSelector.setVisibility(View.GONE);
  titleView.setVisibility(View.GONE);
  subtitleView.setVisibility(View.GONE);
}

Fixed version (ground truth):
@OnClick(R.id.toLayout) void clickToValue(){
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setInputTextView(toValue);
  valueKeyboard.setEntry(toValue.getText().toString());
  currencySelector.setVisibility(View.GONE);
  accountSelector.setVisibility(View.GONE);
  titleView.setVisibility(View.GONE);
  subtitleView.setVisibility(View.GONE);
  fromLayout.setAlpha(INACTIVE_ALPHA);
  toLayout.setAlpha(ACTIVE_ALPHA);
}
Program: 91130
Project: 91130
Buggy source:
@OnClick(R.id.fromValue) void clickFromValue(){
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setInputTextView(fromValue);
  valueKeyboard.setEntry(fromValue.getText().toString());
  currencySelector.setVisibility(View.GONE);
  accountSelector.setVisibility(View.GONE);
  titleView.setVisibility(View.GONE);
  subtitleView.setVisibility(View.GONE);
}

Fixed version (ground truth):
@OnClick(R.id.fromLayout) void clickFromValue(){
  valueKeyboard.setVisibility(View.VISIBLE);
  valueKeyboard.setInputTextView(fromValue);
  valueKeyboard.setEntry(fromValue.getText().toString());
  currencySelector.setVisibility(View.GONE);
  accountSelector.setVisibility(View.GONE);
  titleView.setVisibility(View.GONE);
  subtitleView.setVisibility(View.GONE);
  fromLayout.setAlpha(ACTIVE_ALPHA);
  toLayout.setAlpha(INACTIVE_ALPHA);
}
Program: 91132
Project: 91132
Buggy source:
public PoolStatisticInfo getStatistics(){
  StatRmcService service=StatRmcFactory.getService();
  long totalRmcHashrate=-1;
  try {
    totalRmcHashrate=service.getCommonHashrate();
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  String address=coluAccount.getAddress().toString();
  long yourRmcHashrate=-1;
  try {
    yourRmcHashrate=service.getHashrate(address);
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  long accruedIncome=-1;
  try {
    accruedIncome=service.getBalance(address);
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  try {
    Map<String,List<String>> paidTransactions=service.getPaidTransactions(address);
    if (paidTransactions != null) {
      for (      List<String> thx : paidTransactions.values()) {
        accruedIncome+=Long.parseLong(thx.get(0));
      }
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  PoolStatisticInfo info=new PoolStatisticInfo(totalRmcHashrate,yourRmcHashrate);
  BitcoinNetworkStats stats=getBitcoinNetworkStats();
  if (stats != null) {
    info.difficulty=stats.difficulty;
  }
  info.accruedIncome=accruedIncome;
  return info;
}

Fixed version (ground truth):
public PoolStatisticInfo getStatistics(){
  StatRmcService service=StatRmcFactory.getService();
  long totalRmcHashrate=-1;
  try {
    totalRmcHashrate=service.getCommonHashrate();
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  String address=coluAccount.getAddress().toString();
  long yourRmcHashrate=-1;
  try {
    yourRmcHashrate=service.getHashrate(address);
  }
 catch (  RetrofitError e) {
    if (e.getResponse() != null && e.getResponse().getStatus() == 404) {
      yourRmcHashrate=0;
    }
 else {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  long accruedIncome=-1;
  try {
    accruedIncome=service.getBalance(address);
  }
 catch (  RetrofitError e) {
    if (e.getResponse() != null && e.getResponse().getStatus() == 404) {
      accruedIncome=0;
    }
 else {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  try {
    Map<String,List<String>> paidTransactions=service.getPaidTransactions(address);
    if (paidTransactions != null) {
      for (      List<String> thx : paidTransactions.values()) {
        accruedIncome+=Long.parseLong(thx.get(0));
      }
    }
  }
 catch (  Exception e) {
    Log.e(TAG,"String_Node_Str",e);
  }
  PoolStatisticInfo info=new PoolStatisticInfo(totalRmcHashrate,yourRmcHashrate);
  BitcoinNetworkStats stats=getBitcoinNetworkStats();
  if (stats != null) {
    info.difficulty=stats.difficulty;
  }
  info.accruedIncome=accruedIncome;
  return info;
}
Program: 91134
Project: 91134
Buggy source:
@Override public void run(){
  angle=(angle + 6) % 360;
  if (angle == 0) {
    accrued=accrued.add(BigDecimal.valueOf(value).movePointLeft(8)).setScale(8,BigDecimal.ROUND_UP);
    sharedPreferences.edit().putString(ACCRUED_INCOME + coluAccount.getAddress().toString(),accrued.toPlainString()).apply();
    accruedValue.setText(accrued.stripTrailingZeros().toPlainString() + "String_Node_Str");
    value=0;
  }
 else {
    value+=satPerSec.floatValue();
  }
  adometr.setText("String_Node_Str" + (Math.round(value) > 0 ? String.valueOf(Math.round(value)) : adoFormat.format(value)));
  profitMeterView.setAngle(angle);
  profitMeterView.postDelayed(this,1000);
}

Fixed version (ground truth):
@Override public void run(){
  angle=(angle + 6) % 360;
  SharedPreferences.Editor editor=sharedPreferences.edit();
  if (angle == 0) {
    accrued=accrued.add(BigDecimal.valueOf(value).movePointLeft(8)).setScale(8,BigDecimal.ROUND_UP);
    editor.putString(ACCRUED_INCOME + coluAccount.getAddress().toString(),accrued.toPlainString());
    accruedValue.setText(accrued.stripTrailingZeros().toPlainString() + "String_Node_Str");
    value=0;
  }
 else {
    value+=satPerSec.floatValue();
  }
  editor.putLong(ADOTIME + coluAccount.getAddress().toString(),System.currentTimeMillis());
  editor.putInt(ADOANGLE + coluAccount.getAddress().toString(),angle);
  editor.apply();
  adometr.setText("String_Node_Str" + (Math.round(value) > 0 ? String.valueOf(Math.round(value)) : adoFormat.format(value)));
  profitMeterView.setAngle(angle);
  profitMeterView.postDelayed(this,1000);
}
Program: 91135
Project: 91135
Buggy source:
public AddressWidgetAdapter(Context context,MbwManager mbwManager){
  this.context=context;
  this.mbwManager=mbwManager;
  sharedPreferences=context.getSharedPreferences(PREFERENCE_RMC_PROFIT_METER,Context.MODE_PRIVATE);
  coluAccount=(ColuAccount)mbwManager.getSelectedAccount();
  poolStatisticInfo=new BtcPoolStatisticsManager.PoolStatisticInfo(sharedPreferences.getLong(TOTAL_RMC_HASHRATE,0),sharedPreferences.getLong(YOUR_RMC_HASHRATE + coluAccount.getAddress().toString(),0));
  poolStatisticInfo.difficulty=sharedPreferences.getLong(DIFFICULTY,0);
  accrued=new BigDecimal(sharedPreferences.getString(ACCRUED_INCOME + coluAccount.getAddress().toString(),"String_Node_Str"));
  BtcPoolStatisticsTask task=new BtcPoolStatisticsTask(coluAccount);
  task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}

Fixed version (ground truth):
public AddressWidgetAdapter(Context context,MbwManager mbwManager){
  this.context=context;
  this.mbwManager=mbwManager;
  sharedPreferences=context.getSharedPreferences(PREFERENCE_RMC_PROFIT_METER,Context.MODE_PRIVATE);
  WalletAccount account=mbwManager.getSelectedAccount();
  if (account instanceof ColuAccount) {
    coluAccount=(ColuAccount)mbwManager.getSelectedAccount();
    poolStatisticInfo=new BtcPoolStatisticsManager.PoolStatisticInfo(sharedPreferences.getLong(TOTAL_RMC_HASHRATE,0),sharedPreferences.getLong(YOUR_RMC_HASHRATE + coluAccount.getAddress().toString(),0));
    poolStatisticInfo.difficulty=sharedPreferences.getLong(DIFFICULTY,0);
    accrued=new BigDecimal(sharedPreferences.getString(ACCRUED_INCOME + coluAccount.getAddress().toString(),"String_Node_Str"));
    BtcPoolStatisticsTask task=new BtcPoolStatisticsTask(coluAccount);
    task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
  }
}
Program: 91136
Project: 91136
Buggy source:
@Override public List<TransactionSummary> getTransactionHistory(int offset,int limit){
  if (historyTxList != null) {
    List<TransactionSummary> list=getTransactionSummaries();
    ArrayList<TransactionSummary> result=new ArrayList<>();
    for (    TransactionSummary transactionSummary : list) {
      if (transactionSummary.value.getCurrency().equals(coluAsset.name)) {
        result.add(transactionSummary);
      }
    }
    return limitedList(offset,limit,result);
  }
 else {
    return Lists.newArrayList();
  }
}

Fixed version (ground truth):
@Override public List<TransactionSummary> getTransactionHistory(int offset,int limit){
  if (historyTxList != null) {
    List<TransactionSummary> list=new ArrayList<>(getTransactionSummaries());
    ArrayList<TransactionSummary> result=new ArrayList<>();
    for (    TransactionSummary transactionSummary : list) {
      if (transactionSummary != null && transactionSummary.value.getCurrency().equals(coluAsset.name)) {
        result.add(transactionSummary);
      }
    }
    return limitedList(offset,limit,result);
  }
 else {
    return Lists.newArrayList();
  }
}
Program: 91138
Project: 91138
Buggy source:
public int compare(TransactionSummary p1,TransactionSummary p2){
  return (int)(p2.time - p1.time);
}

Fixed version (ground truth):
public int compare(TransactionSummary p1,TransactionSummary p2){
  if (p2 == null) {
    return -1;
  }
 else   if (p1 == null) {
    return 1;
  }
 else {
    return (int)(p2.time - p1.time);
  }
}
Program: 91139
Project: 91139
Buggy source:
@Override public void onSaveInstanceState(Bundle savedInstanceState){
  super.onSaveInstanceState(savedInstanceState);
  savedInstanceState.putSerializable("String_Node_Str",findViewById(R.id.etAddress).toString());
}

Fixed version (ground truth):
@Override public void onSaveInstanceState(Bundle savedInstanceState){
  super.onSaveInstanceState(savedInstanceState);
  savedInstanceState.putSerializable("String_Node_Str",((EditText)findViewById(R.id.etAddress)).getText().toString());
}
Program: 91140
Project: 91140
Buggy source:
@Override public long computeValue(int position){
  int step=position - minPosition;
  return (long)(minValue * Math.pow(scale,step));
}

Fixed version (ground truth):
@Override public long computeValue(int position){
  int step=position - minPosition;
  return round((double)minValue * pow(scale,step));
}
Program: 91141
Project: 91141
Buggy source:
public ExponentialFeeItemsAlgorithm(long minValue,int minPosition,long maxValue,int maxPosition){
  this.minPosition=minPosition;
  this.maxPosition=maxPosition;
  this.minValue=minValue;
  int steps=maxPosition - minPosition;
  scale=Math.exp(Math.log((double)maxValue / (double)minValue) / (double)steps);
}

Fixed version (ground truth):
public ExponentialFeeItemsAlgorithm(long minValue,int minPosition,long maxValue,int maxPosition){
  this.minPosition=minPosition;
  this.maxPosition=maxPosition;
  this.minValue=minValue;
  int steps=maxPosition - minPosition;
  scale=exp(log((double)maxValue / (double)minValue) / (double)steps);
}
Program: 91142
Project: 91142
Buggy source:
private void verifySingleKeyBackup(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  if (_focusedAccount instanceof SingleAddressAccount || _focusedAccount instanceof ColuAccount) {
    VerifyBackupActivity.callMe(getActivity());
  }
}

Fixed version (ground truth):
private void verifySingleKeyBackup(){
  if (!AccountsFragment.this.isAdded()) {
    return;
  }
  WalletAccount _focusedAccount=accountListAdapter.getFocusedAccount();
  if (_focusedAccount instanceof SingleAddressAccount || _focusedAccount instanceof ColuAccount) {
    VerifyBackupActivity.callMe(getActivity());
  }
}
Program: 91143
Project: 91143
Buggy source:
@Override public void onDestroyActionMode(ActionMode actionMode){
  currentActionMode=null;
  if (_focusedAccount != null) {
    _focusedAccount=null;
    update();
  }
}

Fixed version (ground truth):
@Override public void onDestroyActionMode(ActionMode actionMode){
  currentActionMode=null;
  if (accountListAdapter.getFocusedAccount() != null) {
    accountListAdapter.setFocusedAccount(null);
    update();
  }
}