mapbox / mapbox/mapbox-navigation-android

Test equals, hashCode and toString

Open
#6,200 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

jira-sync-complete
Dominant language
Kotlin
Stars
651
Forks
321
PR merge metrics
No merged PRs in 30d

Description

For non-data classes that override equals, hashCode and toString it's easy to forget to update them when a new parameter is added. The similar problem exists for builders, but for builders there is a test (see `BuilderTest`).
It would be nice to have the same checks for said methods.
We could write them by ourselves or use some libs, for example: `nl.jqno.equalsverifier:equalsverifier`.

Contributor guide

Open the contributing guide

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 reading the existing BuilderTest mentioned in the issue and inspect how non-data classes implement equals, hashCode, and toString. Evaluate whether equalsverifier or hand-written checks fit the project, then add checks that reveal when a newly added parameter is omitted from these methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.