dsmiley commented on code in PR #4011:
URL: https://github.com/apache/solr/pull/4011#discussion_r2667219432
##########
solr/core/src/java/org/apache/solr/handler/admin/api/CreateCore.java:
##########
@@ -158,7 +159,7 @@ private Map<String, String>
buildCoreParams(CreateCoreParams createParams) {
}
public static CreateCoreParams createRequestBodyFromV1Params(SolrParams
solrParams) {
- final var v1ParamMap = solrParams.toMap(new HashMap<>());
+ final var v1ParamMap = new SimpleOrderedMap<>(solrParams);
Review Comment:
There is a subtle semantic difference here. Previously, we had a bonafide
Map. If there were duplicate keys, the last value wins (looking at
Utils.convertToMap, called by toMap). Probably wasn't intended but there is
integrity of the Map contract at least. The constructor you use assumes the
input has no duplicate keys. They will be added, and SimpleOrderedMap will not
quite act exactly like a Map. I'm not sure what the final effect is without
trying/testing. We could change SimpleOrderedMap's constructor here to have a
hack for the NamedList (that isn't SimpleOrderedMap) case. Or don't use
SimpleOrderedMap here, which I can see was chosen for your convenience, not
because it's needed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]