Skip to content

fix: make DependencyInfo.hashCode() consistent with equals()#623

Closed
elharo wants to merge 1 commit into
apache:masterfrom
elharo:fix-620-hashcode-contract
Closed

fix: make DependencyInfo.hashCode() consistent with equals()#623
elharo wants to merge 1 commit into
apache:masterfrom
elharo:fix-620-hashcode-contract

Conversation

@elharo

@elharo elharo commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Fixes #620

equals() compares only the dependency field, but hashCode() incorrectly incorporated both dependency and targetFileName, violating the equals/hashCode contract and causing incorrect behavior in hash-based collections.

equals() compares only the 'dependency' field, but hashCode()
incorrectly incorporated both 'dependency' and 'targetFileName',
violating the equals/hashCode contract. Now hashCode() uses only
'dependency', matching equals().

Fixes apache#620
@elharo elharo force-pushed the fix-620-hashcode-contract branch from 2a811d4 to aa64a57 Compare July 4, 2026 14:25
@elharo elharo closed this Jul 4, 2026
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.

DependencyInfo.hashCode() violates equals/hashCode contract

1 participant