spotbugs: remove unused paramter and add null-check where needed

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2021-02-11 18:27:52 +01:00
parent 0dad4840f1
commit c7a8062f00
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 8 additions and 13 deletions

View file

@ -380,7 +380,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
accountSetupWebviewBinding.loginWebview.loadUrl(url, headers);
setClient(accountSetupWebviewBinding.loginWebviewProgressBar);
setClient();
}
@Override
@ -397,7 +397,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
return super.onKeyDown(keyCode, event);
}
private void setClient(ProgressBar progressBar) {
private void setClient() {
accountSetupWebviewBinding.loginWebview.setWebViewClient(new WebViewClient() {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
@ -743,7 +743,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
private void checkOcServer() {
String uri;
if (accountSetupBinding != null && !accountSetupBinding.hostUrlInput.getText().toString().isEmpty()) {
if (accountSetupBinding != null && accountSetupBinding.hostUrlInput.getText()!= null &&
!accountSetupBinding.hostUrlInput.getText().toString().isEmpty()) {
uri = accountSetupBinding.hostUrlInput.getText().toString().trim();
} else {
uri = mServerInfo.mBaseUrl;
@ -936,7 +937,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
case OK_NO_SSL:
case OK:
if (accountSetupBinding.hostUrlInput
if (accountSetupBinding.hostUrlInput.getText() != null &&
accountSetupBinding.hostUrlInput
.getText()
.toString()
.trim()
@ -1039,7 +1041,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
case OK_NO_SSL:
case OK:
if (showWebViewLoginUrl) {
if (accountSetupBinding.hostUrlInput
if (accountSetupBinding.hostUrlInput.getText() != null &&
accountSetupBinding.hostUrlInput
.getText()
.toString()
.trim()
@ -1467,13 +1470,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
}
}
/**
* For retrieving the clicking on authentication cancel button.
*/
public void doNegativeAuthenticationDialogClick() {
mIsFirstAuthAttempt = true;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);

View file

@ -22,7 +22,6 @@
package com.owncloud.android.ui.activity;
import android.annotation.SuppressLint;
import android.app.DownloadManager;
import android.content.Context;
import android.content.Intent;