3 ms·
equals(Object o) has a very tricky contract to implement, when you add subclassing to the mix. Auto-generated code won't make those problems go away. See http:
by mhansen 17y ago
equals(Object o) has a very tricky contract to implement, when you add subclassing to the mix. Auto-generated code won't make those problems go away.
See http://www.artima.com/lejava/articles/equality.html http://www.artima.com/lejava/articles/equality.html
- joshhart 17y agoI was mostly joking when I wrote the parent comment. I've read Joshua Block's Effective Java which spends a long time discussing the challenges of properly implementing equals. Generally speaking, Eclipse gets it correct. Implementing equals properly boils down to following a set of rules - something that computers are exceptionally good at.