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

Ordered LinkedHashMap#hashCode() implementation #2806

Closed
wants to merge 1 commit into from

Conversation

pivovarit
Copy link
Member

@pivovarit pivovarit commented Aug 28, 2024

To maintain the contract between equals() and hashCode(), the LinkedHashMap#hashCode implementation should account for the order of key-value pairs (tuples).

This ensures that the hashCode reflects the sequence in which entries are added, aligning with the behavior of equals.


Related to: #2803
Fixes: #2733

@pivovarit pivovarit changed the title ordered LinkedHashMap#hashCode() implementation Ordered LinkedHashMap#hashCode() implementation Aug 28, 2024
@pivovarit pivovarit force-pushed the ordered-hashcode-linkedhashmap branch from 1d0c45c to 62f5c00 Compare August 28, 2024 18:15
@pivovarit pivovarit closed this Aug 28, 2024
@pivovarit pivovarit deleted the ordered-hashcode-linkedhashmap branch October 12, 2024 09:45
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.

poor implementation of hashCode of LinkedHashMap
1 participant