Skip to content
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

Closed
wants to merge 1 commit into from
Closed

LUCENE-8640: added changes for the validation of valid dateString #538

wants to merge 1 commit into from

Conversation

MighTguY
Copy link

No description provided.

@MighTguY MighTguY closed this Jan 17, 2019
@MighTguY MighTguY deleted the fix/LUCENE-8640 branch January 17, 2019 01:33
@MighTguY MighTguY restored the fix/LUCENE-8640 branch January 17, 2019 01:33
@MighTguY MighTguY reopened this Jan 17, 2019
@@ -20,7 +20,7 @@
import org.junit.BeforeClass;
import org.junit.Test;

public class DateRangeFieldTest extends SolrTestCaseJ4 {
public class DateRangeFieldTest extends SolrTestCaseJ4 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls exclude from PR

Copy link
Author

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.");

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.

Copy link
Author

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.

Copy link
Author

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

@munendrasn
Copy link
Contributor

Closing this as LUCENE-8640 is resolved

@munendrasn munendrasn closed this Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants