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
LUCENE-8640: added changes for the validation of valid dateString #538
Conversation
@@ -20,7 +20,7 @@ | |||
import org.junit.BeforeClass; | |||
import org.junit.Test; | |||
|
|||
public class DateRangeFieldTest extends SolrTestCaseJ4 { | |||
public class DateRangeFieldTest extends SolrTestCaseJ4 { |
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.
pls exclude from PR
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.
done
private int parseIntegerAndValidate(String str, int offset, int min, int max) { | ||
int val = Integer.parseInt(str.substring(offset, offset+2)); | ||
if((val < min ) || (val>max)) { | ||
throw new IllegalArgumentException("Not valid date."); |
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.
I suppose expected and actual character might be reported here, assuming enclosing ParseException report whole input string and the position. The same is applicable to IAE above.
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.
I have incorporated the same.
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.
@gd-spb-e1m I have incorporated the same, please review
Closing this as LUCENE-8640 is resolved |
No description provided.