You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/11/20 21:34:11 UTC
[commons-vfs] branch master updated: Use Objects.equals().
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-vfs.git
The following commit(s) were added to refs/heads/master by this push:
new 121469b Use Objects.equals().
121469b is described below
commit 121469be92be8e62240a661ff01e653d775c09f7
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 16:34:07 2020 -0500
Use Objects.equals().
---
.../commons/vfs2/auth/StaticUserAuthenticator.java | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
index 43adb33..9aa556a 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/auth/StaticUserAuthenticator.java
@@ -16,6 +16,8 @@
*/
package org.apache.commons.vfs2.auth;
+import java.util.Objects;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.vfs2.UserAuthenticationData;
@@ -101,19 +103,8 @@ public class StaticUserAuthenticator implements UserAuthenticator, Comparable<St
}
final StaticUserAuthenticator other = (StaticUserAuthenticator) obj;
- return equalsNullsafe(domain, other.domain) && equalsNullsafe(username, other.username)
- && equalsNullsafe(password, other.password);
- }
-
- private boolean equalsNullsafe(final String thisString, final String otherString) {
- if (thisString == null) {
- if (otherString != null) {
- return false;
- }
- } else if (!thisString.equals(otherString)) {
- return false;
- }
- return true;
+ return Objects.equals(domain, other.domain) && Objects.equals(username, other.username)
+ && Objects.equals(password, other.password);
}
/**