[
https://issues.apache.org/jira/browse/GEODE-8233?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17129557#comment-17129557
]
ASF GitHub Bot commented on GEODE-8233:
---------------------------------------
dschneider-pivotal commented on a change in pull request #5220:
URL: https://github.com/apache/geode/pull/5220#discussion_r437037866
##########
File path:
geode-redis/src/main/java/org/apache/geode/redis/internal/data/AbstractRedisData.java
##########
@@ -183,4 +184,20 @@ protected void storeChanges(Region<ByteArrayWrapper,
RedisData> region, ByteArra
protected abstract boolean removeFromRegion();
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AbstractRedisData)) {
+ return false;
+ }
+ AbstractRedisData that = (AbstractRedisData) o;
+ return getExpirationTimestamp() == that.getExpirationTimestamp();
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getExpirationTimestamp());
Review comment:
It is but that is not all that is used. That is all we have on
AbstractRedisData. Look at its subclasses and you will see they call
super.hashCode (this method) and then mix in their own fields to the hash.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> add equals and hashCode implementations to RedisData classes
> ------------------------------------------------------------
>
> Key: GEODE-8233
> URL: https://issues.apache.org/jira/browse/GEODE-8233
> Project: Geode
> Issue Type: Improvement
> Components: redis
> Reporter: Darrel Schneider
> Assignee: Darrel Schneider
> Priority: Major
> Fix For: 1.14.0
>
>
> The classes that implement RedisData should override equals and hashCode to
> have implementations that use the actual data.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)