Program: 90994
Project: 90994
Buggy source:
public void onActivityResult(final int requestCode,final int resultCode,final Intent intent){
  Log.d(TAG,"String_Node_Str" + requestCode + "String_Node_Str"+ resultCode);
  if (requestCode == SCAN_RESULT_CODE) {
    if (resultCode != RESULT_OK) {
      if (intent != null) {
        String error=intent.getStringExtra(StringHandlerActivity.RESULT_ERROR);
        if (error != null) {
          makeText(this,error,LENGTH_LONG).show();
        }
      }
    }
 else {
      StringHandlerActivity.ResultType type=(StringHandlerActivity.ResultType)intent.getSerializableExtra(StringHandlerActivity.RESULT_TYPE_KEY);
      if (type == StringHandlerActivity.ResultType.PRIVATE_KEY) {
        InMemoryPrivateKey key=StringHandlerActivity.getPrivateKey(intent);
        _receivingAddress=key.getPublicKey().toAddress(_mbwManager.getNetwork());
      }
 else       if (type == StringHandlerActivity.ResultType.ADDRESS) {
        _receivingAddress=StringHandlerActivity.getAddress(intent);
      }
 else       if (type == StringHandlerActivity.ResultType.URI_WITH_ADDRESS) {
        BitcoinUriWithAddress uri=StringHandlerActivity.getUriWithAddress(intent);
        if (uri.callbackURL != null) {
          _bitcoinUri=uri;
          _paymentFetched=false;
          verifyPaymentRequest(_bitcoinUri);
          return;
        }
        _receivingAddress=uri.address;
        _transactionLabel=uri.label;
        if (uri.amount != null && uri.amount > 0) {
          if (!CurrencyValue.isNullOrZero(_amountToSend)) {
            makeText(this,R.string.amount_changed,LENGTH_LONG).show();
          }
          setAmountToSend(ExactBitcoinValue.from(uri.amount));
        }
      }
 else       if (type == StringHandlerActivity.ResultType.URI) {
        BitcoinUri uri=StringHandlerActivity.getUri(intent);
        if (uri.callbackURL != null) {
          _bitcoinUri=uri;
          _paymentFetched=false;
          verifyPaymentRequest(_bitcoinUri);
          return;
        }
      }
 else       if (type == StringHandlerActivity.ResultType.HD_NODE) {
        setReceivingAddressFromKeynode(StringHandlerActivity.getHdKeyNode(intent));
      }
 else {
        throw new IllegalStateException("String_Node_Str" + type.toString());
      }
    }
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == ADDRESS_BOOK_RESULT_CODE && resultCode == RESULT_OK) {
    String s=Preconditions.checkNotNull(intent.getStringExtra(AddressBookFragment.ADDRESS_RESULT_NAME));
    String result=s.trim();
    Address address=Address.fromString(result,_mbwManager.getNetwork());
    if (address == null) {
      return;
    }
    _receivingAddress=address;
    if (intent.getExtras().containsKey(AddressBookFragment.ADDRESS_RESULT_LABEL)) {
      _receivingLabel=intent.getStringExtra(AddressBookFragment.ADDRESS_RESULT_LABEL);
    }
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == MANUAL_ENTRY_RESULT_CODE && resultCode == RESULT_OK) {
    _receivingAddress=Preconditions.checkNotNull((Address)intent.getSerializableExtra(ManualAddressEntry.ADDRESS_RESULT_NAME));
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == GET_AMOUNT_RESULT_CODE && resultCode == RESULT_OK) {
    CurrencyValue enteredAmount=(CurrencyValue)intent.getSerializableExtra(GetAmountActivity.AMOUNT);
    setAmountToSend(enteredAmount);
    if (!CurrencyValue.isNullOrZero(_amountToSend)) {
      _transactionStatus=tryCreateUnsignedTransaction();
    }
    updateUi();
  }
 else   if (requestCode == SIGN_TRANSACTION_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      _signedTransaction=(Transaction)Preconditions.checkNotNull(intent.getSerializableExtra("String_Node_Str"));
      if (_paymentRequestHandler != null && _paymentRequestHandler.getPaymentRequestInformation().hasPaymentCallbackUrl()) {
        if (!_paymentRequestHandler.getPaymentRequestInformation().isExpired()) {
          _paymentRequestHandler.sendResponse(_signedTransaction,_account.getReceivingAddress().get());
        }
 else {
          makeText(this,getString(R.string.payment_request_not_sent_expired),LENGTH_LONG).show();
        }
      }
 else {
        BroadcastTransactionActivity.callMe(this,_account.getId(),_isColdStorage,_signedTransaction,_transactionLabel,getFiatValue(),BROADCAST_REQUEST_CODE);
      }
    }
  }
 else   if (requestCode == BROADCAST_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      transactionFiatValuePref.edit().putString(intent.getStringExtra(Constants.TRANSACTION_HASH_INTENT_KEY),intent.getStringExtra(Constants.TRANSACTION_FIAT_VALUE_KEY)).apply();
    }
    this.setResult(resultCode,intent);
    finish();
  }
 else   if (requestCode == REQUEST_PAYMENT_HANDLER) {
    if (resultCode == RESULT_OK) {
      _paymentRequestHandlerUuid=Preconditions.checkNotNull(intent.getStringExtra("String_Node_Str"));
      if (_paymentRequestHandlerUuid != null) {
        _paymentRequestHandler=(PaymentRequestHandler)_mbwManager.getBackgroundObjectsCache().getIfPresent(_paymentRequestHandlerUuid);
      }
 else {
        _paymentRequestHandler=null;
      }
      _transactionStatus=tryCreateUnsignedTransaction();
      updateUi();
    }
 else {
      setResult(RESULT_CANCELED);
      finish();
    }
  }
 else   if (requestCode == REQUET_BTC_ACCOUNT) {
    if (resultCode == RESULT_OK) {
      UUID id=(UUID)intent.getSerializableExtra(AddressBookFragment.ADDRESS_RESULT_ID);
      fundColuAccount=_mbwManager.getWalletManager(false).getAccount(id);
    }
  }
 else {
    super.onActivityResult(requestCode,resultCode,intent);
  }
}

Fixed version (ground truth):
public void onActivityResult(final int requestCode,final int resultCode,final Intent intent){
  Log.d(TAG,"String_Node_Str" + requestCode + "String_Node_Str"+ resultCode);
  if (requestCode == SCAN_RESULT_CODE) {
    if (resultCode != RESULT_OK) {
      if (intent != null) {
        String error=intent.getStringExtra(StringHandlerActivity.RESULT_ERROR);
        if (error != null) {
          makeText(this,error,LENGTH_LONG).show();
        }
      }
    }
 else {
      StringHandlerActivity.ResultType type=(StringHandlerActivity.ResultType)intent.getSerializableExtra(StringHandlerActivity.RESULT_TYPE_KEY);
      if (type == StringHandlerActivity.ResultType.PRIVATE_KEY) {
        InMemoryPrivateKey key=StringHandlerActivity.getPrivateKey(intent);
        _receivingAddress=key.getPublicKey().toAddress(_mbwManager.getNetwork());
      }
 else       if (type == StringHandlerActivity.ResultType.ADDRESS) {
        _receivingAddress=StringHandlerActivity.getAddress(intent);
      }
 else       if (type == StringHandlerActivity.ResultType.URI_WITH_ADDRESS) {
        BitcoinUriWithAddress uri=StringHandlerActivity.getUriWithAddress(intent);
        if (uri.callbackURL != null) {
          _bitcoinUri=uri;
          _paymentFetched=false;
          verifyPaymentRequest(_bitcoinUri);
          return;
        }
        _receivingAddress=uri.address;
        _transactionLabel=uri.label;
        if (uri.amount != null && uri.amount > 0) {
          if (!CurrencyValue.isNullOrZero(_amountToSend)) {
            makeText(this,R.string.amount_changed,LENGTH_LONG).show();
          }
          setAmountToSend(ExactBitcoinValue.from(uri.amount));
        }
      }
 else       if (type == StringHandlerActivity.ResultType.URI) {
        BitcoinUri uri=StringHandlerActivity.getUri(intent);
        if (uri.callbackURL != null) {
          _bitcoinUri=uri;
          _paymentFetched=false;
          verifyPaymentRequest(_bitcoinUri);
          return;
        }
      }
 else       if (type == StringHandlerActivity.ResultType.HD_NODE) {
        setReceivingAddressFromKeynode(StringHandlerActivity.getHdKeyNode(intent));
      }
 else {
        throw new IllegalStateException("String_Node_Str" + type.toString());
      }
    }
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == ADDRESS_BOOK_RESULT_CODE && resultCode == RESULT_OK) {
    String s=Preconditions.checkNotNull(intent.getStringExtra(AddressBookFragment.ADDRESS_RESULT_NAME));
    String result=s.trim();
    Address address=Address.fromString(result,_mbwManager.getNetwork());
    if (address == null) {
      return;
    }
    _receivingAddress=address;
    if (intent.getExtras().containsKey(AddressBookFragment.ADDRESS_RESULT_LABEL)) {
      _receivingLabel=intent.getStringExtra(AddressBookFragment.ADDRESS_RESULT_LABEL);
    }
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == MANUAL_ENTRY_RESULT_CODE && resultCode == RESULT_OK) {
    _receivingAddress=Preconditions.checkNotNull((Address)intent.getSerializableExtra(ManualAddressEntry.ADDRESS_RESULT_NAME));
    _transactionStatus=tryCreateUnsignedTransaction();
    updateUi();
  }
 else   if (requestCode == GET_AMOUNT_RESULT_CODE && resultCode == RESULT_OK) {
    CurrencyValue enteredAmount=(CurrencyValue)intent.getSerializableExtra(GetAmountActivity.AMOUNT);
    setAmountToSend(enteredAmount);
    if (!CurrencyValue.isNullOrZero(_amountToSend)) {
      _transactionStatus=tryCreateUnsignedTransaction();
    }
    updateUi();
  }
 else   if (requestCode == SIGN_TRANSACTION_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      _signedTransaction=(Transaction)Preconditions.checkNotNull(intent.getSerializableExtra("String_Node_Str"));
      if (_paymentRequestHandler != null && _paymentRequestHandler.getPaymentRequestInformation().hasPaymentCallbackUrl()) {
        if (!_paymentRequestHandler.getPaymentRequestInformation().isExpired()) {
          _paymentRequestHandler.sendResponse(_signedTransaction,_account.getReceivingAddress().get());
        }
 else {
          makeText(this,getString(R.string.payment_request_not_sent_expired),LENGTH_LONG).show();
        }
      }
 else {
        BroadcastTransactionActivity.callMe(this,_account.getId(),_isColdStorage,_signedTransaction,_transactionLabel,getFiatValue(),BROADCAST_REQUEST_CODE);
      }
    }
  }
 else   if (requestCode == BROADCAST_REQUEST_CODE) {
    if (resultCode == RESULT_OK) {
      transactionFiatValuePref.edit().putString(intent.getStringExtra(Constants.TRANSACTION_ID_INTENT_KEY),intent.getStringExtra(Constants.TRANSACTION_FIAT_VALUE_KEY)).apply();
    }
    this.setResult(resultCode,intent);
    finish();
  }
 else   if (requestCode == REQUEST_PAYMENT_HANDLER) {
    if (resultCode == RESULT_OK) {
      _paymentRequestHandlerUuid=Preconditions.checkNotNull(intent.getStringExtra("String_Node_Str"));
      if (_paymentRequestHandlerUuid != null) {
        _paymentRequestHandler=(PaymentRequestHandler)_mbwManager.getBackgroundObjectsCache().getIfPresent(_paymentRequestHandlerUuid);
      }
 else {
        _paymentRequestHandler=null;
      }
      _transactionStatus=tryCreateUnsignedTransaction();
      updateUi();
    }
 else {
      setResult(RESULT_CANCELED);
      finish();
    }
  }
 else   if (requestCode == REQUET_BTC_ACCOUNT) {
    if (resultCode == RESULT_OK) {
      UUID id=(UUID)intent.getSerializableExtra(AddressBookFragment.ADDRESS_RESULT_ID);
      fundColuAccount=_mbwManager.getWalletManager(false).getAccount(id);
    }
  }
 else {
    super.onActivityResult(requestCode,resultCode,intent);
  }
}