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

Hoss Man commented on SOLR-2920:
--------------------------------

David:

+1 to the refactoring ... thta's a great idea to help eliminate bugs

-0 to the names SolrParams.combine and SolrParams.combineAppended .. "combine" 
doesn't really make it clear what it's doing, it sounds more like a merge then 
wrapping in a defaults.

What do you think about putting each of these static methods in their 
respective classes?... "params = DefaultSolrParams.wrap(params,defaults)" and 
"params = AppendedSolrParamswrap(params,extra)" ?

(BTW: can you config your IDE to not reorder import statements?  makes patches 
a lot harder to review)
                
> Refactor frequent conditional use of DefaultSolrParams into 
> SolrParams.combine(p,d)
> -----------------------------------------------------------------------------------
>
>                 Key: SOLR-2920
>                 URL: https://issues.apache.org/jira/browse/SOLR-2920
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: SOLR-2920_SolrParams_combine().patch
>
>
> I had a small bug in use of DefaultSolrParams in my code because I didn't 
> check for non-existent defaults.  I noticed through the Solr codebase that is 
> code pattern is very common:
> {code:java}
>     if( defaults != null ) {
>       params = new DefaultSolrParams( params, defaults );
>     }
> {code}
> Instead, I refactored this logic into a new SolrParams.combine(p,d) method 
> and made it so that nobody refers to DefaultSolrParams.  I did similarly for 
> AppendedSolrParams.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to