isaric commented on code in PR #4464:
URL: https://github.com/apache/solr/pull/4464#discussion_r3381614598
##########
solr/core/src/java/org/apache/solr/handler/admin/BaseHandlerApiSupport.java:
##########
@@ -195,26 +196,27 @@ public Map<String, Object> toMap(Map<String, Object>
suppliedMap) {
: map.get(key);
if (o == null) o = pathValues.get(key);
if (o == null && useRequestParams) o = origParams.getParams(key);
+ if (o == null) continue;
// make strings out of as many things as we can now to minimize
differences from
// the standard impls that pass through a
NamedList/SimpleOrderedMap...
Class<?> oClass = o.getClass();
if (oClass.isPrimitive()
|| Number.class.isAssignableFrom(oClass)
|| Character.class.isAssignableFrom(oClass)
|| Boolean.class.isAssignableFrom(oClass)) {
- suppliedMap.put(param, String.valueOf(o));
+ ew.put(param, String.valueOf(o));
} else if (List.class.isAssignableFrom(oClass)
+ && !((List) o).isEmpty()
&& ((List) o).get(0) instanceof String) {
Review Comment:
Addressed — `if (l.isEmpty() || l.get(0) instanceof String)`
(BaseHandlerApiSupport.java:211) treats empty lists as `String[0]`, matching
the prior invariant for multi-valued string params.
--
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]