Ensure hash codes immutability
- Dominant language
- Java
- Stars
- 44
- Forks
- 15
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 12
Description
In PBJ, we often delegate to Java `Integer.hashCode()`, `Double.hashCode()`, `String.hashCode()` etc. when computing hash codes for PBJ models. While JDK implementations of those methods are unlikely to change, that might happen in theory. Since we persist the computed hash codes, ~we need to add some tests to get alerted if JDK starts computing different hash codes for the same input values.~
...we want to implement `hashCode()` for primitive types ourselves by borrowing the current implementations from JDK (so as to end up with the same numerical values for the hashes.) And then we want to make PBJ use our custom implementations instead of delegating to JDK implementations which may change from release to release, or from one JDK vendor implementation to another.
Contributor guide
Assessment
This issue has not been assessed yet.