New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOLR-16483: Fix IndexOutOfBounds in RecursiveNumericEvaluator #1054
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acsbendi can you add a test case for this? looks like its a streaming expression potentially?
@risdenk Sure, where should I add one? Yes, this happened in a streaming expression, should I add a test for that streaming expression? |
@acsbendi https://github.com/apache/solr/blob/main/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java potentially or one of the other existing classes under https://github.com/apache/solr/tree/main/solr/solrj/src/test/org/apache/solr/client/solrj/io |
I do see a https://github.com/apache/solr/blob/main/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RecursiveEvaluatorTest.java, but no |
@risdenk I've added a test for it, and checked that it fails without my fix:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @acsbendi - running ./gradlew check -x test
would surface a few errors.
Assert....
shouldn't be needed. just useassertEquals
- Add license header that matches other tests
solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MovingAverageEvaluatorTest.java
Show resolved
Hide resolved
solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MovingAverageEvaluatorTest.java
Outdated
Show resolved
Hide resolved
My pleasure:) The problems are fixed now |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@acsbendi this looks good. I'm going to create a jira ticket and make a minor change (add solr/CHANGES.txt entry)
Thanks @acsbendi |
@risdenk You're welcome, glad to be able to contribute! |
https://issues.apache.org/jira/browse/SOLR-16483
Description
This change fixes the following exception:
Solution
I check if the list if empty before accessing its first item.
Tests
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.