Program: 35662
Project: 35662
Buggy source:
private void checkEverything(){
  String credentials=ApiHelper.getCredentials(username,token);
  cookieManager.getCookieStore().removeAll();
  roomsQueryDisposable=ncApi.getRooms(credentials,ApiHelper.getUrlForGetRooms(baseUrl)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(roomsOverall -> {
    progressText.setText(String.format(getResources().getString(R.string.nc_nextcloud_talk_app_installed),getResources().getString(R.string.nc_app_name)));
    profileQueryDisposable=ncApi.getUserProfile(credentials,ApiHelper.getUrlForUserProfile(baseUrl)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(userProfileOverall -> {
      progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_fetched));
      String displayName=null;
      if (!TextUtils.isEmpty(userProfileOverall.getOcs().getData().getDisplayName())) {
        displayName=userProfileOverall.getOcs().getData().getDisplayName();
      }
 else       if (!TextUtils.isEmpty(userProfileOverall.getOcs().getData().getDisplayNameAlt())) {
        displayName=userProfileOverall.getOcs().getData().getDisplayNameAlt();
      }
      if (!TextUtils.isEmpty(displayName)) {
        dbQueryDisposable=userUtils.createOrUpdateUser(username,token,baseUrl,displayName,null,true).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(userEntity -> {
          progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_stored));
          new JobRequest.Builder(PushRegistrationJob.TAG).setUpdateCurrent(true).startNow().build().schedule();
          cookieManager.getCookieStore().removeAll();
          userUtils.disableAllUsersWithoutId(userEntity.getId());
          if (userUtils.getUsers().size() == 1) {
            getRouter().setRoot(RouterTransaction.with(new MagicBottomNavigationController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
          }
 else {
            ErrorMessageHolder.getInstance().setMessageType(ErrorMessageHolder.ErrorMessageType.ACCOUNT_WAS_IMPORTED);
            getRouter().popToRoot();
          }
        }
,throwable -> {
          progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_stored));
          abortVerification();
        }
,() -> dispose(dbQueryDisposable));
      }
 else {
        progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_fetched));
        abortVerification();
      }
    }
,throwable -> {
      progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_fetched));
      abortVerification();
    }
,() -> dispose(profileQueryDisposable));
  }
,throwable -> {
    progressText.setText(String.format(getResources().getString(R.string.nc_nextcloud_talk_app_not_installed),getResources().getString(R.string.nc_app_name)));
    ErrorMessageHolder.getInstance().setMessageType(ErrorMessageHolder.ErrorMessageType.SERVER_WITHOUT_TALK);
    abortVerification();
  }
,() -> dispose(roomsQueryDisposable));
}

Fixed version (ground truth):
private void checkEverything(){
  String credentials=ApiHelper.getCredentials(username,token);
  cookieManager.getCookieStore().removeAll();
  roomsQueryDisposable=ncApi.getRooms(credentials,ApiHelper.getUrlForGetRooms(baseUrl)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(roomsOverall -> {
    progressText.setText(String.format(getResources().getString(R.string.nc_nextcloud_talk_app_installed),getResources().getString(R.string.nc_app_name)));
    profileQueryDisposable=ncApi.getUserProfile(credentials,ApiHelper.getUrlForUserProfile(baseUrl)).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(userProfileOverall -> {
      progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_fetched));
      String displayName=null;
      if (!TextUtils.isEmpty(userProfileOverall.getOcs().getData().getDisplayName())) {
        displayName=userProfileOverall.getOcs().getData().getDisplayName();
      }
 else       if (!TextUtils.isEmpty(userProfileOverall.getOcs().getData().getDisplayNameAlt())) {
        displayName=userProfileOverall.getOcs().getData().getDisplayNameAlt();
      }
      if (!TextUtils.isEmpty(displayName)) {
        dbQueryDisposable=userUtils.createOrUpdateUser(username,token,baseUrl,displayName,null,true,userProfileOverall.getOcs().getData().getUserId()).subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread()).subscribe(userEntity -> {
          progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_stored));
          new JobRequest.Builder(PushRegistrationJob.TAG).setUpdateCurrent(true).startNow().build().schedule();
          cookieManager.getCookieStore().removeAll();
          userUtils.disableAllUsersWithoutId(userEntity.getId());
          if (userUtils.getUsers().size() == 1) {
            getRouter().setRoot(RouterTransaction.with(new MagicBottomNavigationController()).pushChangeHandler(new HorizontalChangeHandler()).popChangeHandler(new HorizontalChangeHandler()));
          }
 else {
            ErrorMessageHolder.getInstance().setMessageType(ErrorMessageHolder.ErrorMessageType.ACCOUNT_WAS_IMPORTED);
            getRouter().popToRoot();
          }
        }
,throwable -> {
          progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_stored));
          abortVerification();
        }
,() -> dispose(dbQueryDisposable));
      }
 else {
        progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_fetched));
        abortVerification();
      }
    }
,throwable -> {
      progressText.setText(progressText.getText().toString() + "String_Node_Str" + getResources().getString(R.string.nc_display_name_not_fetched));
      abortVerification();
    }
,() -> dispose(profileQueryDisposable));
  }
,throwable -> {
    progressText.setText(String.format(getResources().getString(R.string.nc_nextcloud_talk_app_not_installed),getResources().getString(R.string.nc_app_name)));
    ErrorMessageHolder.getInstance().setMessageType(ErrorMessageHolder.ErrorMessageType.SERVER_WITHOUT_TALK);
    abortVerification();
  }
,() -> dispose(roomsQueryDisposable));
}