sgift commented on code in PR #913:
URL: https://github.com/apache/solr/pull/913#discussion_r906395456


##########
solr/solrj/src/java/org/apache/solr/common/util/JavaBinCodec.java:
##########
@@ -1080,6 +1083,15 @@ public boolean writePrimitive(Object val) throws 
IOException {
       daos.writeByte(DATE);
       daos.writeLong(((Date) val).getTime());
       return true;
+    } else if (val instanceof Instant) {
+      daos.writeByte(DATE);
+      daos.writeLong(((Instant) val).toEpochMilli());
+    } else if (val instanceof LocalDate) {
+      daos.writeByte(DATE);
+      daos.writeLong(((LocalDate) val).toEpochDay());

Review Comment:
   Thanks for spotting this and the proposed fix, but you got me thinking: Solr 
already has ParseDateFieldUpdateProcessorFactory to parse date strings and all 
JSR310 classes have a toString representation which can be parsed by it. 
Instead of trying to convert all to Date I've changed the code to convert them 
to their String representation and then ParseDateFieldUpdateProcessorFactory 
can parse it back on the server side. I think that's a better solution?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to