mirror of https://github.com/apache/lucene.git
Align instanceof check with type cast (#13039)
This commit is contained in:
parent
39c10a2929
commit
13ea880508
|
@ -62,7 +62,7 @@ public class PayloadAttributeImpl extends AttributeImpl implements PayloadAttrib
|
|||
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;
|
||||
|
|
|
@ -38,13 +38,11 @@ import org.apache.lucene.queryparser.flexible.core.nodes.NoTokenFoundQueryNode;
|
|||
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;
|
||||
|
||||
|
@ -107,10 +105,9 @@ public class AnalyzerQueryNodeProcessor extends QueryNodeProcessorImpl {
|
|||
@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);
|
||||
|
|
Loading…
Reference in New Issue