zrlw commented on issue #15632:
URL: https://github.com/apache/dubbo/issues/15632#issuecomment-3190375116
do you mean the ```equals``` method of DefaultServiceInstance should not
check timestamp?
```
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof DefaultServiceInstance)) {
return false;
}
DefaultServiceInstance that = (DefaultServiceInstance) o;
boolean equals = Objects.equals(getServiceName(),
that.getServiceName())
&& Objects.equals(getHost(), that.getHost())
&& Objects.equals(getPort(), that.getPort());
for (Map.Entry<String, String> entry :
this.getMetadata().entrySet()) {
if
(entry.getKey().equals(EXPORTED_SERVICES_REVISION_PROPERTY_NAME)) {
continue;
}
// don't compare timestamp?
if (entry.getKey().equals("timestamp") {
continue;
}
if (entry.getValue() == null) {
equals = equals && (entry.getValue() ==
that.getMetadata().get(entry.getKey()));
} else {
equals = equals &&
entry.getValue().equals(that.getMetadata().get(entry.getKey()));
}
}
return equals;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]