jpountz commented on a change in pull request #212: URL: https://github.com/apache/lucene/pull/212#discussion_r671012619
########## File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/CombinedFieldQuery.java ########## @@ -212,13 +226,18 @@ public String toString(String field) { } @Override - public int hashCode() { - return 31 * classHash() + Arrays.hashCode(terms); + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; Review comment: use `Query#sameClassAs` ? ########## File path: lucene/sandbox/src/java/org/apache/lucene/sandbox/search/CombinedFieldQuery.java ########## @@ -212,13 +226,18 @@ public String toString(String field) { } @Override - public int hashCode() { - return 31 * classHash() + Arrays.hashCode(terms); + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CombinedFieldQuery that = (CombinedFieldQuery) o; + return Objects.equals(fieldAndWeights, that.fieldAndWeights) && Arrays.equals(terms, that.terms); } @Override - public boolean equals(Object other) { - return sameClassAs(other) && Arrays.equals(terms, ((CombinedFieldQuery) other).terms); + public int hashCode() { + int result = Objects.hash(fieldAndWeights); + result = 31 * result + Arrays.hashCode(terms); Review comment: use `classHash()` in the hashcode? -- 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. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org