twosom commented on code in PR #12040: URL: https://github.com/apache/lucene/pull/12040#discussion_r1057574839
########## lucene/core/src/java/org/apache/lucene/search/BooleanQuery.java: ########## @@ -204,11 +204,11 @@ BooleanQuery rewriteNoScoring(IndexSearcher indexSearcher) throws IOException { for (BooleanClause clause : clauses) { Query query = clause.getQuery(); Query rewritten = new ConstantScoreQuery(query).rewrite(indexSearcher); - if (rewritten instanceof ConstantScoreQuery) { - rewritten = ((ConstantScoreQuery) rewritten).getQuery(); + if (rewritten instanceof ConstantScoreQuery constantScoreQuery) { + rewritten = constantScoreQuery.getQuery(); } BooleanClause.Occur occur = clause.getOccur(); - if (occur == Occur.SHOULD && keepShould == false) { + if (occur == Occur.SHOULD && !keepShould) { Review Comment: Thanks to reply. I'll keep `== false`😊 -- 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