[ 
https://issues.apache.org/jira/browse/SOLR-6576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14154316#comment-14154316
 ] 

Steve Davids commented on SOLR-6576:
------------------------------------

Yea, this is a bit misleading as ModifiableSolrParams.add( String name, String 
... val ) says:

bq. Add the given values to any existing name

The behavior of this particular method works as expected, I would likewise 
assume that the "add" for SolrParams would work just the same way. That would 
be like saying we had a map with two methods: put(K key, V value) and 
putAll(Map<? extends K,? extends V> m) but did two completely different things.

So in my head I would think the method for the current functionality would 
mimic the "set" capability:

bq. Replace any existing parameter with the given name.

and should be named appropriately. Also, SolrParams.wrapAppended(SolrParams) is 
deprecated so that isn't very re-assuring to use :)

> ModifiableSolrParams#add(SolrParams) is performing a set operation instead of 
> an add
> ------------------------------------------------------------------------------------
>
>                 Key: SOLR-6576
>                 URL: https://issues.apache.org/jira/browse/SOLR-6576
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Steve Davids
>             Fix For: 5.0, Trunk
>
>         Attachments: SOLR-6576.patch
>
>
> Came across this bug by attempting to append multiple ModifiableSolrParam 
> objects together but found the last one was clobbering the previously set 
> values. The add operation should append the values to the previously defined 
> values, not perform a set operation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to