Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

zzzadruga
Copy link
Contributor

No description provided.

@@ -1059,6 +1059,12 @@ private void remap() {
/** {@inheritDoc} */
@SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
Copy link
Contributor

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))
Copy link
Contributor

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)
Copy link
Contributor

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"})
Copy link
Contributor

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)
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants