New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-9160 Fix equals() methods #4478
base: master
Are you sure you want to change the base?
Conversation
@@ -1059,6 +1059,12 @@ private void remap() { | |||
/** {@inheritDoc} */ | |||
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary line
if (this == o) | ||
return true; | ||
|
||
if (!(o instanceof MappingKey)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this condition looks less readable than without 'NOT'.
Look at 'java.lang.String#equals'.
That touches all 'equals' methods.
@@ -887,6 +887,9 @@ private CancelMessageId(long reqId, UUID nodeId) { | |||
if (obj == this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is @SuppressWarnings({"unchecked"}) unnecessary line?
@@ -640,12 +640,12 @@ public IgniteTxKey key() { | |||
/** {@inheritDoc} */ | |||
@SuppressWarnings({"unchecked"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is @SuppressWarnings({"unchecked"}) unnecessary line?
// | ||
// if (getClass() != obj.getClass()) | ||
// return false; | ||
if (this == obj) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's wrong.
Maybe state when a.hashCode() != b.hashCode() but a.equals(b) is true.
No description provided.