You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tapan Vaishnav (JIRA)" <ji...@apache.org> on 2018/03/23 08:51:00 UTC

[jira] [Comment Edited] (SOLR-11913) SolrParams ought to implement Iterable>

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

Tapan Vaishnav edited comment on SOLR-11913 at 3/23/18 8:50 AM:
----------------------------------------------------------------

{quote}The default impl can produce a Map.Entry with a getValue that calls through to getParams.
{quote}
This I didn't think of. Thanks for pointing it out, have fixed now and will upload with the latest patch.
I have fixed the typo in testcase and added the override annotation. (though haven't uploaded the patch yet.)
{quote}BTW try ant precommit. Hopefully it'll show you that you need to use @Override
{quote}
I tried doing so but it gave me some error stating _Rat problems were found!_ . I tried searching over the internet but couldn't find anything useful, did some playing around build.xml but all was in waste.

Anyways, what I want to ask is when you said about callers of getParameterNamesiterator(), did you mean callers in SolrParams class only or all callers of that iterator function?
What I mean to say is there are some functions in SolrParam class which are using getParameterNamesiterator() and we can modify those functions for Java 5 foreach or Java 8 stream style. Or there are some classes which are extending the SolrParams like ModifiableSolrParams, MultiMapSolrParams etc which are using getParameterNamesiterator() and we can modify those for Java 5 foreach or Java 8 stream style. Though ModifiableSolrParams is just an example, I check for this class and it is using getParameterNamesiterator() for its add(SolrParams params) function which has never been called, so no point in changing that, I guess.


was (Author: tvaishna):
{quote}The default impl can produce a Map.Entry with a getValue that calls through to getParams.
{quote}
This I didn't think of. Thanks for pointing it out, have fixed now and will upload with the latest patch.
I have fixed the typo in testcase and added the override annotation. (though haven't uploaded the patch yet.)
{quote}BTW try ant precommit. Hopefully it'll show you that you need to use @Override
{quote}
I tried doing so but it gave me some error stating _Rat problems were found!_ . I tried searching over the internet but couldn't find anything useful, did some playing around build.xml but all was in waste.

Anyways, what I want to ask is when you said about callers of getParameterNamesiterator(), did you mean callers in SolrParams class only or all callers of that iterator function?
I mean there are some functions in SolrParam class which are using getParameterNamesiterator() and we can modify those functions for Java 5 foreach or Java 8 stream style. Or there are some classes which are extending the SolrParams like ModifiableSolrParams, MultiMapSolrParams etc which are using getParameterNamesiterator() and we can modify those for Java 5 foreach or Java 8 stream style. Though ModifiableSolrParams is just an example, I check for this class and it is using getParameterNamesiterator() for its add(SolrParams params) function which has never been called, so no point in changing that, I guess.

> SolrParams ought to implement Iterable<Map.Entry<String,String[]>>
> ------------------------------------------------------------------
>
>                 Key: SOLR-11913
>                 URL: https://issues.apache.org/jira/browse/SOLR-11913
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Priority: Minor
>              Labels: newdev
>         Attachments: SOLR-11913.patch, SOLR-11913.patch, SOLR-11913_v2.patch
>
>
> SolrJ ought to implement {{Iterable<Map.Entry<String,String[]>>}} so that it's easier to iterate on it, either using Java 5 for-each style, or Java 8 streams.  The implementation on ModifiableSolrParams can delegate through to the underlying LinkedHashMap entry set.  The default impl can produce a Map.Entry with a getValue that calls through to getParams.  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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