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:28:44 UTC
[commons-jcs] 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-jcs.git
The following commit(s) were added to refs/heads/master by this push:
new 79c9e46 Use Objects.equals().
79c9e46 is described below
commit 79c9e468564e1ee77b2eed8a8e7258fa4d77950b
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Nov 20 16:28:39 2020 -0500
Use Objects.equals().
---
.../apache/commons/jcs3/utils/discovery/DiscoveredService.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/DiscoveredService.java b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/DiscoveredService.java
index d2f252c..eefbc9e 100644
--- a/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/DiscoveredService.java
+++ b/commons-jcs-core/src/main/java/org/apache/commons/jcs3/utils/discovery/DiscoveredService.java
@@ -21,6 +21,7 @@ package org.apache.commons.jcs3.utils.discovery;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Objects;
/**
* This contains info about a discovered service. These objects are stored in a set in the
@@ -148,13 +149,7 @@ public class DiscoveredService
return false;
}
DiscoveredService other = (DiscoveredService) otherArg;
- if (serviceAddress == null)
- {
- if (other.serviceAddress != null)
- {
- return false;
- }
- } else if (!serviceAddress.equals(other.serviceAddress))
+ if (!Objects.equals(serviceAddress, other.serviceAddress))
{
return false;
}