This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 58d77c2a7 [#3818]Fix the mismatch between the equals method and the
hashCode method in the ServiceCombServer class. (#3819)
58d77c2a7 is described below
commit 58d77c2a7732c9595f0e69c8edc617f8cf614749
Author: lennonchan <[email protected]>
AuthorDate: Tue Jun 6 18:10:16 2023 +0800
[#3818]Fix the mismatch between the equals method and the hashCode method
in the ServiceCombServer class. (#3819)
---
.../java/org/apache/servicecomb/loadbalance/ServiceCombServer.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServer.java
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServer.java
index bcf255f1a..8a34dc20e 100644
---
a/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServer.java
+++
b/handlers/handler-loadbalance/src/main/java/org/apache/servicecomb/loadbalance/ServiceCombServer.java
@@ -19,6 +19,7 @@ package org.apache.servicecomb.loadbalance;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.apache.servicecomb.core.Endpoint;
@@ -114,6 +115,6 @@ public class ServiceCombServer extends Server {
@Override
public int hashCode() {
- return this.instance.getInstanceId().hashCode();
+ return Objects.hash(this.instance.getInstanceId(), this.endpoint);
}
}