lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Smiley (Updated) (JIRA)" <>
Subject [jira] [Updated] (SOLR-2920) Refactor frequent conditional use of DefaultSolrParams into SolrParams.combine(p,d)
Date Thu, 08 Dec 2011 22:59:39 GMT


David Smiley updated SOLR-2920:

    Attachment: SOLR-2920_SolrParams_wrapDefaults_and_wrapAppended.patch

I attached a new patch using wrapDefaults and wrapAppended, and I took care to retain the
import statements according to Lucene/Solr's strict standards ;-)

I think it's still an open-question if we want to more aggressively take the SolrParams factory-method
approach and create some methods that return a MapSolrParams, ModifiableSolrParams, MultiMapSolrParams,
and RequiredSolrParams.  Personally, I really like the idea of SolrParams being a one-stop
shop for these.

> Refactor frequent conditional use of DefaultSolrParams into SolrParams.combine(p,d)
> -----------------------------------------------------------------------------------
>                 Key: SOLR-2920
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments: SOLR-2920_SolrParams_combine().patch, SOLR-2920_SolrParams_wrapDefaults_and_wrapAppended.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:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message