sabi0 commented on code in PR #13039:
URL: https://github.com/apache/lucene/pull/13039#discussion_r1470102508
##########
lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/processors/AnalyzerQueryNodeProcessor.java:
##########
@@ -107,10 +105,9 @@ public QueryNode process(QueryNode queryTree) throws
QueryNodeException {
@Override
protected QueryNode postProcessNode(QueryNode node) throws
QueryNodeException {
- if (node instanceof TextableQueryNode
+ if (node instanceof FieldQueryNode
Review Comment:
'node' is cast below to `FieldQueryNode`. But the condition here was
checking for a base type `TextableQueryNode`, excluding some sub-types. If a
new `TextableQueryNode` sub-type was added the code below could run into a CCE.
Having the `instanceof FieldQueryNode` condition here makes the type cast
below safe. And also eliminates the need to exclude the `RegexpQueryNode` as it
does not subclass `FieldQueryNode`.
--
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]