Program: 69225
Project: 69225
Buggy source:
private void importMnemonicAccount(){
  btnImportAccount.setEnabled(false);
  etAccountName.setError(null);
  etPassword.setError(null);
  etRepeatPassword.setError(null);
  String mnemonics=etMnemonic.getText().toString().trim();
  String name=etAccountName.getText().toString().trim();
  String password=etPassword.getText().toString();
  String repeatPassword=etRepeatPassword.getText().toString();
  boolean cancel=false;
  View focusView=null;
  if (TextUtils.isEmpty(mnemonics)) {
    focusView=etMnemonic;
    Toast.makeText(getActivity(),R.string.error_field_required,Toast.LENGTH_LONG).show();
    cancel=true;
  }
  if (!cancel && TextUtils.isEmpty(name)) {
    etAccountName.setError(getString(R.string.error_field_required));
    focusView=etAccountName;
    cancel=true;
  }
  if (!cancel && accounts != null && accounts.size() > 0) {
    for (    AccountEntity accountEntity : accounts) {
      if (accountEntity.getName().equals(name)) {
        cancel=true;
        break;
      }
    }
    if (cancel) {
      etAccountName.setError(getString(R.string.error_incorrect_name));
      focusView=etAccountName;
    }
  }
  if (!cancel && !password.equals(repeatPassword)) {
    etPassword.setError(getString(R.string.error_incorrect_password));
    focusView=etPassword;
    cancel=true;
  }
  if (cancel) {
    focusView.requestFocus();
    btnImportAccount.setEnabled(true);
    return;
  }
  if (CommonUtil.isValidMnemonics(mnemonics)) {
    customProgressDialog=new CustomProgressDialog(getActivity(),R.style.CustomProgressDialogStyle,getString(R.string.progress_import_account));
    customProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    customProgressDialog.setCancelable(false);
    customProgressDialog.show();
    mViewModel.importAccountWithMnemonics(mnemonics,password,name).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<String>(){
      @Override public void onNext(      String address){
        customProgressDialog.cancel();
        if (address != null && WalletUtils.isValidAddress(address)) {
          Toast.makeText(getContext(),R.string.success_import_account,Toast.LENGTH_SHORT).show();
          getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
          Intent intent=new Intent();
          getActivity().setResult(Activity.RESULT_OK,intent);
          getActivity().finish();
        }
 else         if (address != null && address.length() == 0) {
          AlertDialog dialogTip=new AlertDialog.Builder(getContext()).setMessage(R.string.error_account_exists).setNegativeButton(R.string.cancel,(dialog,which) -> dialog.cancel()).create();
          dialogTip.show();
          etMnemonic.requestFocus();
          btnImportAccount.setEnabled(true);
        }
 else {
          Toast.makeText(getContext(),R.string.error_mnemonics,Toast.LENGTH_LONG).show();
          etMnemonic.requestFocus();
          btnImportAccount.setEnabled(true);
        }
      }
      @Override public void onError(      Throwable e){
        e.printStackTrace();
        Toast.makeText(getContext(),R.string.error_mnemonics,Toast.LENGTH_LONG).show();
        customProgressDialog.cancel();
        etMnemonic.requestFocus();
        btnImportAccount.setEnabled(true);
      }
      @Override public void onCompleted(){
      }
    }
);
  }
 else {
    Toast.makeText(getContext(),R.string.error_mnemonics_length,Toast.LENGTH_LONG).show();
    etMnemonic.requestFocus();
    btnImportAccount.setEnabled(true);
  }
}

Fixed version (ground truth):
private void importMnemonicAccount(){
  btnImportAccount.setEnabled(false);
  etAccountName.setError(null);
  etPassword.setError(null);
  etRepeatPassword.setError(null);
  String mnemonics=etMnemonic.getText().toString().trim();
  String name=etAccountName.getText().toString().trim();
  String password=etPassword.getText().toString();
  String repeatPassword=etRepeatPassword.getText().toString();
  boolean cancel=false;
  View focusView=null;
  if (TextUtils.isEmpty(mnemonics)) {
    focusView=etMnemonic;
    Toast.makeText(getActivity(),R.string.error_field_required,Toast.LENGTH_LONG).show();
    cancel=true;
  }
  if (!cancel && TextUtils.isEmpty(name)) {
    etAccountName.setError(getString(R.string.error_field_required));
    focusView=etAccountName;
    cancel=true;
  }
  if (!cancel && accounts != null && accounts.size() > 0) {
    for (    AccountEntity accountEntity : accounts) {
      if (accountEntity.getName().equals(name)) {
        cancel=true;
        break;
      }
    }
    if (cancel) {
      etAccountName.setError(getString(R.string.error_incorrect_name));
      focusView=etAccountName;
    }
  }
  if (!cancel && !password.equals(repeatPassword)) {
    etPassword.setError(getString(R.string.error_incorrect_password));
    focusView=etPassword;
    cancel=true;
  }
  if (cancel) {
    focusView.requestFocus();
    btnImportAccount.setEnabled(true);
    return;
  }
  if (CommonUtil.isValidMnemonics(mnemonics)) {
    customProgressDialog=new CustomProgressDialog(getActivity(),R.style.CustomProgressDialogStyle,getString(R.string.progress_import_account));
    customProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
    customProgressDialog.setCancelable(false);
    customProgressDialog.show();
    mViewModel.importAccountWithMnemonics(mnemonics,password,name).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<String>(){
      @Override public void onNext(      String address){
        customProgressDialog.cancel();
        if (address != null && WalletUtils.isValidAddress(address)) {
          Toast.makeText(getContext(),R.string.success_import_account,Toast.LENGTH_SHORT).show();
          getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
          Intent intent=new Intent();
          getActivity().setResult(Activity.RESULT_OK,intent);
          getActivity().finish();
        }
 else         if (address != null && address.length() == 0) {
          AlertDialog dialogTip=new AlertDialog.Builder(getContext()).setMessage(R.string.error_account_exists).setNegativeButton(R.string.cancel,(dialog,which) -> dialog.cancel()).create();
          dialogTip.show();
          etMnemonic.requestFocus();
          btnImportAccount.setEnabled(true);
        }
 else {
          Toast.makeText(getContext(),R.string.error_mnemonics,Toast.LENGTH_LONG).show();
          etMnemonic.requestFocus();
          btnImportAccount.setEnabled(true);
        }
      }
      @Override public void onError(      Throwable e){
        e.printStackTrace();
        AlertDialog dialogTip=new AlertDialog.Builder(getContext()).setMessage(R.string.error_mnemonics).setNegativeButton(R.string.cancel,(dialog,which) -> dialog.cancel()).create();
        dialogTip.show();
        customProgressDialog.cancel();
        etMnemonic.requestFocus();
        btnImportAccount.setEnabled(true);
      }
      @Override public void onCompleted(){
      }
    }
);
  }
 else {
    Toast.makeText(getContext(),R.string.error_mnemonics_length,Toast.LENGTH_LONG).show();
    etMnemonic.requestFocus();
    btnImportAccount.setEnabled(true);
  }
}