[jira] [Commented] (SOLR-6576) ModifiableSolrParams#add(SolrParams) is performing a set operation instead of an add

2014-10-01 Thread Hoss Man (JIRA)

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

Hoss Man commented on SOLR-6576:


bq. So in my head I would think the method for the current functionality would 
mimic the set capability ... and should be named appropriately. 

I don't disagree with you, it's just the missfortune of how the API evolved w/o 
people giving a more critical eye to what those methods were named.

bq. Also, SolrParams.wrapAppended(SolrParams) is deprecated so that isn't very 
re-assuring to use.

Uh? ... no it's not what makes you say that?

https://lucene.apache.org/solr/4_10_0/solr-solrj/org/apache/solr/common/params/SolrParams.html#wrapAppended%28org.apache.solr.common.params.SolrParams,%20org.apache.solr.common.params.SolrParams%29

 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6576) ModifiableSolrParams#add(SolrParams) is performing a set operation instead of an add

2014-10-01 Thread Steve Davids (JIRA)

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

Steve Davids commented on SOLR-6576:


Oops, I glanced at the code too fast last night and saw the suppress deprecated 
warning:

{code}
@SuppressWarnings({deprecation})
public static SolrParams wrapAppended(SolrParams params, SolrParams defaults) {
{code}

which I mistook as @deprecated for some reason, my bad.

 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6576) ModifiableSolrParams#add(SolrParams) is performing a set operation instead of an add

2014-09-30 Thread Hoss Man (JIRA)

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

Hoss Man commented on SOLR-6576:


I haven't looked at this closely, but I think the behavior you are observing is 
intentional -- although it almost certainly needs better docs, and is probably 
not the best name.

I think the intent here was for ModifiableSolrParam.add(SolrParams) to be 
analogous to Map.putAll(Map).  It's not a shortcut for adding all of _values_ 
associated with each key in the argument SolrParams object; it's a method for 
updating the current SolrParams object to have all of the _params_ (keys and 
values) in the argument SolrParams object

Since the semantics are clearly ambiguous, and a change like this could really 
screw things up for existing users who expect the current behavior, the best 
course of action may be to deprecate the method completely and add new methods 
with more clear names?

(FWIW: your desired goal is exactly what SolrParams.wrapAppended(SolrParams) 
was designed for.)

 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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-6576) ModifiableSolrParams#add(SolrParams) is performing a set operation instead of an add

2014-09-30 Thread Steve Davids (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-6576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org