MighTguY commented on a change in pull request #538: LUCENE-8640: added changes 
for the validation of valid dateString
URL: https://github.com/apache/lucene-solr/pull/538#discussion_r250035191
 
 

 ##########
 File path: 
lucene/spatial-extras/src/java/org/apache/lucene/spatial/prefix/tree/DateRangePrefixTree.java
 ##########
 @@ -500,4 +516,18 @@ public Calendar parseCalendar(String str) throws 
ParseException {
     throw new ParseException("Improperly formatted date: "+str, offset);
   }
 
+  private  void isValidDateDelimeter(String str, int offset, char delim) {
+    if(str.charAt(offset) != delim) {
+      throw new IllegalArgumentException("Not the valid delimeter for 
Position"+offset);
+    }
+  }
+
+  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.");
 
 Review comment:
   @gd-spb-e1m I have incorporated the same, please review

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to