Fix EqBehavior bug introduced by #1434 #1614
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the issue
The
NON_DAEMON
IndexRegistry returnstrue
for all calls tosupportsExpression
. This leads to an incorrect result from thegetEqBehavior
method where we getMATCH
instead ofEQ
because the index indicates that it can handleANALYZER_MATCHES
expressions andEQ
expressions.It is an odd edge case because the javadoc for the
NON_DAEMON
object is:This presents a problem for the eq/match logic where we want to find a nuanced solution to the different solutions. My proposal here is to just make it use the EQ behavior, but that might have adverse side effects in untested code.
What does this PR fix and why was it fixed
The original fix used in #1434 was just to avoid the NPE we hit, but it allowed for the wrong result in eq behavior. This fix is to say that we should just return
EQ
in that case. It's possible this fix has negative consequences that we haven't seen yet, but at the very least, the CNDB tests pass with it.