cognitect / cognitect/transit-java

Override equals() and hashCode() in Impl-Classes

Open
#26 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
65
Forks
23
PR merge metrics
No merged PRs in 30d

Description

I think LinkImpl, RatioImpl etc. should override equals() and hashCode() more consistently.

  • LinkImpl doesn't override any of the two
  • RatioImpl overrides equals(), but not hashCode(). And the implementation of equals() relies on object identity of the numerators und denominators

My suggestions would be to generate all equals and hashCode implementations for these classes with your IDE of choice.

I would have created a pr, but I read you dont accept any...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting LinkImpl, RatioImpl, and the other implementation classes to compare their existing equals() and hashCode() behavior. Done means the relevant classes consistently satisfy the equals/hashCode contract, including a decided treatment of numerator and denominator identity.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.