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 <[email protected]>
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;
}