Skip to content

Commit

Permalink
Align instanceof check with type cast (#13039)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabi0 committed Jan 30, 2024
1 parent 39c10a2 commit 13ea880
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public boolean equals(Object other) {
return true;
}

if (other instanceof PayloadAttribute) {
if (other instanceof PayloadAttributeImpl) {
PayloadAttributeImpl o = (PayloadAttributeImpl) other;
if (o.payload == null || payload == null) {
return o.payload == null && payload == null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@
import org.apache.lucene.queryparser.flexible.core.nodes.QueryNode;
import org.apache.lucene.queryparser.flexible.core.nodes.QuotedFieldQueryNode;
import org.apache.lucene.queryparser.flexible.core.nodes.RangeQueryNode;
import org.apache.lucene.queryparser.flexible.core.nodes.TextableQueryNode;
import org.apache.lucene.queryparser.flexible.core.nodes.TokenizedPhraseQueryNode;
import org.apache.lucene.queryparser.flexible.core.processors.QueryNodeProcessorImpl;
import org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler.ConfigurationKeys;
import org.apache.lucene.queryparser.flexible.standard.config.StandardQueryConfigHandler.Operator;
import org.apache.lucene.queryparser.flexible.standard.nodes.MultiPhraseQueryNode;
import org.apache.lucene.queryparser.flexible.standard.nodes.RegexpQueryNode;
import org.apache.lucene.queryparser.flexible.standard.nodes.SynonymQueryNode;
import org.apache.lucene.queryparser.flexible.standard.nodes.WildcardQueryNode;

Expand Down Expand Up @@ -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
&& !(node instanceof WildcardQueryNode)
&& !(node instanceof FuzzyQueryNode)
&& !(node instanceof RegexpQueryNode)
&& !(node.getParent() instanceof RangeQueryNode)) {

FieldQueryNode fieldNode = ((FieldQueryNode) node);
Expand Down

0 comments on commit 13ea880

Please sign in to comment.