msokolov commented on code in PR #859: URL: https://github.com/apache/lucene/pull/859#discussion_r862982712
########## lucene/core/src/java/org/apache/lucene/search/KnnVectorQuery.java: ########## @@ -288,15 +288,20 @@ public void visit(QueryVisitor visitor) { @Override public boolean equals(Object obj) { - return sameClassAs(obj) - && ((KnnVectorQuery) obj).k == k - && ((KnnVectorQuery) obj).field.equals(field) - && Arrays.equals(((KnnVectorQuery) obj).target, target); + if (sameClassAs(obj) == false) { + return false; + } + return ((KnnVectorQuery) obj).k == k + && ((KnnVectorQuery) obj).field.equals(field) + && Arrays.equals(((KnnVectorQuery) obj).target, target) + && ((KnnVectorQuery) obj).filter == null + ? filter == null Review Comment: How about using Objects.equals(filter, ((KnnVectorQuery) obj).filter)? This will handle the null==null case -- 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