sabi0 commented on code in PR #13041: URL: https://github.com/apache/lucene/pull/13041#discussion_r1468923263
########## lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/TokenizedPhraseQueryNode.java: ########## @@ -70,10 +70,8 @@ public QueryNode cloneTree() throws CloneNotSupportedException { @Override public CharSequence getField() { List<QueryNode> children = getChildren(); - - if (children == null || children.size() == 0) { + if (children == null || children.isEmpty()) { return null; - } else { return ((FieldableNode) children.get(0)).getField(); Review Comment: According to the `setField(CharSequence)` method below children are not necessarily `FieldableNode`. I.e. this line might throw `ClassCastException`? -- 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