You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some equals() implementation you can find string fields compared ignoring the case. If, for instance, you have such implementation of equals() and hashCode() ![image](https://user-images.githubusercontent.com/12230922/209340938-c04bcbc2-c0b0-4326-91c8-3814e6e7de02.png)
The contract is broken, because two class instances with inst1.field= "AAA" and inst2.field = "aaa" would be equal but with different hashCode().
I propose to create a test case that checks in case equals() fires on strings that differ only on case, hashCode() must be consistent
The text was updated successfully, but these errors were encountered:
I don't have a lot of time to spend on EqualsVerifier these days though, so it might be a little while before I get to it. I'll keep you posted. I'm open to PR's though 🙂
In some equals() implementation you can find string fields compared ignoring the case. If, for instance, you have such implementation of equals() and hashCode()
![image](https://user-images.githubusercontent.com/12230922/209340938-c04bcbc2-c0b0-4326-91c8-3814e6e7de02.png)
The contract is broken, because two class instances with inst1.field= "AAA" and inst2.field = "aaa" would be equal but with different hashCode().
I propose to create a test case that checks in case equals() fires on strings that differ only on case, hashCode() must be consistent
The text was updated successfully, but these errors were encountered: