From b69169f457c38abe50f8828d8c0e53a477b55b5e Mon Sep 17 00:00:00 2001 From: Jens Mueller Date: Wed, 17 Apr 2019 22:43:22 +0200 Subject: [PATCH] unify empty string compare Signed-off-by: Jens Mueller --- src/main/java/com/owncloud/android/datamodel/OCFile.java | 2 +- .../com/owncloud/android/ui/activity/PassCodeActivity.java | 3 ++- .../android/ui/activity/ReceiveExternalFilesActivity.java | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/owncloud/android/datamodel/OCFile.java b/src/main/java/com/owncloud/android/datamodel/OCFile.java index 1cd8cffeba..afaf7334b6 100644 --- a/src/main/java/com/owncloud/android/datamodel/OCFile.java +++ b/src/main/java/com/owncloud/android/datamodel/OCFile.java @@ -493,7 +493,7 @@ public class OCFile implements Parcelable, Comparable, ServerFileInterfa } public boolean isInConflict() { - return etagInConflict != null && !"".equals(etagInConflict); + return !TextUtils.isEmpty(etagInConflict); } public boolean isSharedWithMe() { diff --git a/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java b/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java index 5d50058e42..60063d52fe 100644 --- a/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/PassCodeActivity.java @@ -26,6 +26,7 @@ import android.content.Intent; import android.graphics.PorterDuff; import android.os.Bundle; import android.text.Editable; +import android.text.TextUtils; import android.text.TextWatcher; import android.view.KeyEvent; import android.view.View; @@ -204,7 +205,7 @@ public class PassCodeActivity extends AppCompatActivity implements Injectable { private void onPassCodeEditTextFocusChange(final int passCodeIndex) { for (int i = 0; i < passCodeIndex; i++) { - if ("".equals(mPassCodeEditTexts[i].getText().toString())) { + if (TextUtils.isEmpty(mPassCodeEditTexts[i].getText())) { mPassCodeEditTexts[i].requestFocus(); break; } diff --git a/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java b/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java index 683426418b..9b86cb0fca 100755 --- a/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java +++ b/src/main/java/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java @@ -43,6 +43,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Parcelable; +import android.text.TextUtils; import android.text.format.DateFormat; import android.view.LayoutInflater; import android.view.Menu; @@ -750,7 +751,7 @@ public class ReceiveExternalFilesActivity extends FileActivity boolean notRoot = mParents.size() > 1; if (actionBar != null) { - if ("".equals(current_dir)) { + if (TextUtils.isEmpty(current_dir)) { ThemeUtils.setColoredTitle(actionBar, R.string.uploader_top_message, this); } else { ThemeUtils.setColoredTitle(actionBar, current_dir, this);