dsmiley commented on code in PR #1466:
URL: https://github.com/apache/solr/pull/1466#discussion_r1144038630


##########
solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java:
##########
@@ -885,7 +884,7 @@ private static SolrInputDocument 
toSolrInputDocument(SolrDocument doc, IndexSche
           if (!fieldArrayListCreated && doc.getFieldValue(fname) instanceof 
Collection) {
             // previous value was array so we must return as an array even if 
was a single value
             // array
-            out.setField(fname, Lists.newArrayList(val));
+            out.setField(fname, new ArrayList<>(List.of(val)));

Review Comment:
   Ok I see.
   This method looks more complicated than it needs to be.  I don't think this 
condition needs to put "val" into the "out" doc, it could probably put a new 
ArrayList and then at the end of the loop over values, addField will be called, 
and this doc will be added to the existing value.  If I'm too confusing, I 
could try contributing this change.



-- 
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