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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]