You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2021/04/07 13:28:33 UTC

[GitHub] [drill] eevanwong edited a comment on pull request #2191: Drill 7882 + Drill 7883 - Fix LGTM Alerts in /common and /contrib

eevanwong edited a comment on pull request #2191:
URL: https://github.com/apache/drill/pull/2191#issuecomment-814914037


   Hey so, a bit of an update, for hash code and equals, tuns out you in fact do need both.
   
   > Yes, this is a legitimate concern. The contract between hashCode and equals is that equal instances must have the same hashCode. The reverse is not necessary, but high quality hashCode algorithms should avoid this as much as possible.
   
   According to javadoc for the equals method:
   
       Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
   
   https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object) 


-- 
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:
users@infra.apache.org