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

Jörg Rathlev commented on SOLR-9184:
------------------------------------

Sorry about removing the first patch file. I accidentally left a println added 
for debugging in the first version and removed it.

This change simply adds a static factory method, it does not propose to modify 
the existing constructor. I agree that intentional use of the copy constructor 
is a valid use case that must be supported.

> Add convenience method to ModifiableSolrParams
> ----------------------------------------------
>
>                 Key: SOLR-9184
>                 URL: https://issues.apache.org/jira/browse/SOLR-9184
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>            Reporter: Jörg Rathlev
>            Priority: Minor
>         Attachments: SOLR-9184.patch
>
>
> Add a static convenience method {{ModifiableSolrParams#of(SolrParams)}} which 
> returns the same instance if it already is modifiable, otherwise creates a 
> new {{ModifiableSolrParams}} instance.
> Rationale: when writing custom SearchComponents, we find that we often need 
> to ensure that the SolrParams are modifiable. The copy constructor of 
> ModifiableSolrParams always creates a copy, even if the SolrParms already are 
> modifiable.
> Alternatives: The method could also be added as a convenience method in 
> SolrParams itself, which already has static helper methods for wrapDefaults 
> and wrapAppended.



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

Reply via email to