You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2009/02/19 20:38:01 UTC

[jira] Updated: (SOLR-967) NamedList - Deprecating ctor. with heterogenous List and replacing with a type-safe variant.

     [ https://issues.apache.org/jira/browse/SOLR-967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-967:
--------------------------

    Attachment: SOLR-967.patch

Kay: I made a few modifications to your patch...

1) tweaked some of the docs. you had a cut/paste sentence in the new constructor that contradicted the later sentences, i also cleaned up exactly what the commitments are from each constructor, and what the expectations should be for users.  We also don't need to tell people that the explicit backing of the LIst constructor will go away in future versions, because it will only go away when the method goes away (we can't add a pure List<Entry> constructor for a while after removing the current List constructor because of type erasure and people possibly skipping versions when upgrading)

2) i changed the new constructor to take Map.Entry<String, ? extends T>[] instead of Map.Entry<String, ?>[] ... unless i'm missing something a completely unbounded type wildcard would be just as bad as the untyped List.

how does this look to you?


> NamedList - Deprecating ctor. with heterogenous List and replacing with a type-safe variant. 
> ---------------------------------------------------------------------------------------------
>
>                 Key: SOLR-967
>                 URL: https://issues.apache.org/jira/browse/SOLR-967
>             Project: Solr
>          Issue Type: Improvement
>         Environment: Java 6, Tomcat 6
>            Reporter: Kay Kay
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-967.patch, SOLR-967.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> NamedList (org/apache/solr/common/util/NamedList ) currently has a heterogenous List (even numbered indices are String-s ) and the odd-numbered indices are the specific types.  As per benchmarks ( see SOLR-912 ) - the implementation could be improved in favor of a Map.Entry<String, T> that beats in performance and ease of code maintenance. 
> As per the discussion in SOLR-912 , a separate issue in JIRA is created that temporarily deprecates the List ctor. in NamedList and replaces the same with a Map.Entry<String, T> [] arg. constructor . 
> This would be go in 1.4 to enable people to migrate their code for the new ctor. and move away from List<?> . 
> At a later version of Solr (may be v2) - the optimal implementation would be brought back in with the List <Map.Entry<String, ?> > for better type-safety and performance. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.