-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
Team LampreybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Subject of the issue
While working on #340 (comment), I observed numerous instances where equals is overwritten, but not hashCode.
The status quo breaks hashCode's contract as discussed in https://stackoverflow.com/questions/2265503/why-do-i-need-to-override-the-equals-and-hashcode-methods-in-java.
Your environment
N/A
Steps to reproduce
N/A
Expected behaviour
There's at least 2 solutions:
- Immediately - Consistently override
hashCodeandequals. Prefer using an IDE-generated implementation. - Longer term - Upgrade to >= JDK 16 and replace class definitions with records (https://docs.oracle.com/en/java/javase/16/language/records.html). Among other benefits, records obviate the need to manage
equalsandhashCodeimplementations.
Actual behaviour
N/A
Acceptance Criteria
- Updating hand written code to implement both functions.
- Update code generator to generate hashCode along with equals, then regenerate the code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Team LampreybugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers