Open GoogleCodeExporter opened 9 years ago
It's not a bug, though it might be worth changing. See an analogous discussion
at
https://github.com/google/guava/issues/2037
Note also that such things are pretty common, e.g., the hashcodes of all these
three strings equal 3587: "ps", "qT", "r5". And there are 560 such 3-way
collisions among alphanumeric strings of length 2.
PS: You're wrong concerning `new StringWrapper()` and `new StringWrapper(null)`
as they ARE equal (not "==", just "equals").
Original comment by Maaarti...@gmail.com
on 6 Jun 2015 at 10:14
I should have been more clear:
1- Yes, it's not a requirement, but more of a recommendation (for improved hash
table performance)
2- In #2 above, I have an OR between 'new StringWrapper ()' and 'new
StringWrapper(null)' meaning either one. I didn't mean the two shouldn't be
equal. I meant 'new StringWrapper("")' should not be equal to either of the two
(which are equal to each other).
Original comment by copo...@gmail.com
on 6 Jun 2015 at 5:48
Original issue reported on code.google.com by
copo...@gmail.com
on 4 Jun 2015 at 11:17