lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willis Blackburn (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SOLR-2744) SolrQuery should override ModifiableSolrParams methods that return this and return SolrQuery
Date Sun, 04 Sep 2011 19:43:10 GMT
SolrQuery should override ModifiableSolrParams methods that return this and return SolrQuery
--------------------------------------------------------------------------------------------

                 Key: SOLR-2744
                 URL: https://issues.apache.org/jira/browse/SOLR-2744
             Project: Solr
          Issue Type: Improvement
            Reporter: Willis Blackburn


Because the methods of ModifiableSolrParams that return "this" are declared to return ModifiableSolrParams,
as soon as the code calls one of those methods on an object that is in fact a SolrQuery, it
cannot chain any more SolrQuery-specific methods.

Java allows covariant return types, so a simple solution is to redefine those methods in SolrQuery
to return SolrQuery.  For example:

{noformat}
public SolrQuery add( String name, String ... val ) {
    super.add(name, val);
    return this;
}
{noformat}


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


Mime
View raw message