[ https://issues.apache.org/jira/browse/DRILL-4359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15135139#comment-15135139 ]
ASF GitHub Bot commented on DRILL-4359: --------------------------------------- Github user jaltekruse commented on a diff in the pull request: https://github.com/apache/drill/pull/363#discussion_r52080108 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/physical/EndpointAffinity.java --- @@ -96,6 +96,42 @@ public boolean isAssignmentRequired() { } @Override + public int hashCode() { + final int prime = 31; + int result = 1; + long temp; + temp = Double.doubleToLongBits(affinity); + result = prime * result + (int) (temp ^ (temp >>> 32)); + result = prime * result + ((endpoint == null) ? 0 : endpoint.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof EndpointAffinity)) { + return false; + } + EndpointAffinity other = (EndpointAffinity) obj; + if (Double.doubleToLongBits(affinity) != Double.doubleToLongBits(other.affinity)) { + return false; + } + if (endpoint == null) { + if (other.endpoint != null) { + return false; + } + } else if (!endpoint.equals(other.endpoint)) { --- End diff -- It looks like DrillbitEndpoint also lacks equals and hashcode methods, are these going to be necessary for your tests as well? > EndpointAffinity missing equals method > -------------------------------------- > > Key: DRILL-4359 > URL: https://issues.apache.org/jira/browse/DRILL-4359 > Project: Apache Drill > Issue Type: Improvement > Reporter: Laurent Goujon > Assignee: Laurent Goujon > Priority: Trivial > > EndpointAffinity is a placeholder class, but has no equals method to allow > comparison. -- This message was sent by Atlassian JIRA (v6.3.4#6332)