ndimiduk commented on pull request #1922: URL: https://github.com/apache/hbase/pull/1922#issuecomment-672338834
> > what new commit are you seeking? Are there unaddressed comments? > > That's because you marked it as resolved, although I don't think so. > So -0. Oh, I found it. And Github won't let me un-resolve that comment. If I have the correct comment, you have this attached to the `hashCode` function introduced on `MergeNormalizationPlan.java` > Step back, I don't think it ever needs hashCode() method, they are currently stored in ArrayList only. Why not implement it when needed. I add these methods because these classes are effectively POJOs. They're passed around as data objects in collections. The [`java.util.Collection`](https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html) base class talks about implementations making use of `equals` and `hashCode` -- since Java 1.2. Not having `equals` and `hashCode` implementations leaves room for bugs to creep in. For me, it's good code hygiene -- if you implement a POJO with member fields, and you expect it to be used by arbitrary future developers in mundane ways, then you also add some basic methods: `toString`, `equals`, `hashCode`. Can you explain why this change in controversial? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
