pragmatic-objects / oo-atom

A Java polyfill for better code design
MIT License
23 stars 2 forks source link

atom$hashCode calls hashCode on non-atom fields. #225

Closed skapral closed 5 years ago

skapral commented 5 years ago

Steps to reproduce:

1) Create a class with some field of non-atom type 2) Instantiate an object from the class and call hashCode on it 3) Check that hashCode of non-atom type is not called

For object equivalence purposes, System.identityHashCode must be called instead of non-atom hashCode, because for non-atom it is impossible to check and ensure equivalence.