SpreadsheetCell overrides equals but not hashCode. I fixed that. And since equality was tested with instance of, I made both methods final so subclasses can not break the equals contract by overriding it.
And even though I had the strong feeling that getText is not supposed to return null, I wrote both methods such that there are no NPEs.
Perhaps I should have opened a ticket but that would have been more work than to quickly fix it...
That was actually the first thing I did three weeks ago. :)
I simply wan't sure :)
@eryzhikov Your comment about Objects got removed. What do you mean when you say, there's an API for that? I used Objects for calling for calling equals and hashCode on possibly null objects - is there anything more I should have used it for?
Sorry, did not see it in the hashCode for some reason :). Your pull request looks good to me.
I'll let @shadzic make final decision on this one
Ok, no worries. :) I'm just very curious to learn from "the big guys" and thought I overlooked something. Anyways, I'll always be very thankful for advice - especially on best practices.
I admit I've put on some weight recently, but no need to resort to name calling :-)