Program: 86985
Project: 86985
Buggy source:
public void setUpButtons(){
  doneButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if ((selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_NONE && selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && passphraseEditText.getText().toString().equals("String_Node_Str")) || selectedPassphrasetype == Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && pattern == null) {
        AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
        builder.setTitle(R.string.alert_no_passphrase_title).setMessage(R.string.alert_no_passphrase_message);
        builder.setPositiveButton(R.string.ok,null);
        builder.create().show();
        return;
      }
 else {
        if (selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_NONE && selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && !passphraseEditText.getText().toString().equals(passphraseConfirmationEditText.getText().toString())) {
          AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
          builder.setTitle(R.string.alert_no_passphrase_match_title).setMessage(R.string.alert_no_passphrase_match_message);
          builder.setPositiveButton(R.string.ok,null);
          builder.create().show();
          return;
        }
      }
      Passphrase masterPassphrase=PassphraseFactory.getPassphraseInstance(selectedPassphrasetype,passphraseEditText.getText().toString(),passphraseEditText.getText().toString(),pattern);
      Passphrase.setMasterPassword(masterPassphrase,getActivity());
      Toast.makeText(getActivity(),getString(R.string.master_password_set),Toast.LENGTH_SHORT).show();
      mMasterPasswordSetListener.onMasterPasswordSet();
    }
  }
);
  cancelButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
      builder.setTitle(R.string.alert_cancel_add_environment_title).setMessage(R.string.alert_cancel_master_password_message);
      builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          mMasterPasswordSetListener.onCancelSetMasterPassword();
        }
      }
);
      builder.setNegativeButton(R.string.cancel,null);
      builder.create().show();
    }
  }
);
}

Fixed version (ground truth):
public void setUpButtons(){
  doneButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if ((selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_NONE && selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && passphraseEditText.getText().toString().equals("String_Node_Str")) || selectedPassphrasetype == Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && pattern == null) {
        AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
        builder.setTitle(R.string.alert_no_passphrase_title).setMessage(R.string.alert_no_passphrase_message);
        builder.setPositiveButton(R.string.ok,null);
        builder.create().show();
        return;
      }
 else {
        if (selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_NONE && selectedPassphrasetype != Passphrase.INDEX_PASSPHRASE_TYPE_PATTERN && !passphraseEditText.getText().toString().equals(passphraseConfirmationEditText.getText().toString())) {
          AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
          builder.setTitle(R.string.alert_no_passphrase_match_title).setMessage(R.string.alert_no_passphrase_match_message);
          builder.setPositiveButton(R.string.ok,null);
          builder.create().show();
          return;
        }
      }
      Passphrase masterPassphrase=PassphraseFactory.getPassphraseInstance(selectedPassphrasetype,passphraseEditText.getText().toString(),passphraseEditText.getText().toString(),pattern);
      Passphrase.setMasterPassword(masterPassphrase,getActivity());
      getActivity().startService(BaseService.getServiceIntent(getActivity(),null,BaseService.ACTION_DETECT_ENVIRONMENT));
      mMasterPasswordSetListener.onMasterPasswordSet();
    }
  }
);
  cancelButton.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
      builder.setTitle(R.string.alert_cancel_add_environment_title).setMessage(R.string.alert_cancel_master_password_message);
      builder.setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
        @Override public void onClick(        DialogInterface dialog,        int which){
          mMasterPasswordSetListener.onCancelSetMasterPassword();
        }
      }
);
      builder.setNegativeButton(R.string.cancel,null);
      builder.create().show();
    }
  }
);
}