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

Fix detekt's EqualsWithHashCodeExist warnings #236

Merged
merged 1 commit into from
May 21, 2022
Merged

Fix detekt's EqualsWithHashCodeExist warnings #236

merged 1 commit into from
May 21, 2022

Conversation

jtraglia
Copy link
Contributor

This PR fixes the EqualsWithHashCodeExist according to what detekt says should be done in cases of inheritance.

All hash-based collections depend on objects meeting the equals-contract. Two equal objects must produce the same hashcode. When inheriting equals or hashcode, override the inherited and call the super method for clarification.

Also added a default Key.hashCode() function.

Copy link
Collaborator

@Nashatyrev Nashatyrev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nashatyrev Nashatyrev merged commit e2a8324 into libp2p:develop May 21, 2022
@Nashatyrev
Copy link
Collaborator

@jtraglia Oh sorry, thought you were able to merge it :(

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.

2 participants