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

Hoss Man commented on SOLR-912:
-------------------------------

Kay: It occurs to me that one thing we could do is invert the nature of your 
patch:
# add an "Entry<String, T>[]" constructor (with a warning, but no commitment, 
that modifying the array conents _may_ affect the NamedList) which builds up a 
pairwise List<Object> and delegates to the existing "List" constructor
# deprecate the existing List constructor.  

Anyone using the new constructor will get the type safety benefits (not 
entirely enforced by the compiler, but enforced by the contract) and at some 
later date (Solr 2?) we can remove the "List" constructor and replace the guts 
of the class with your approach (to get the perf improvements)

thoughts?

> org.apache.solr.common.util.NamedList - Typesafe efficient variant - 
> ModernNamedList introduced - implementing the same API as NamedList
> ----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-912
>                 URL: https://issues.apache.org/jira/browse/SOLR-912
>             Project: Solr
>          Issue Type: Improvement
>          Components: search
>    Affects Versions: 1.4
>         Environment: Tomcat 6, JRE 6, Solr 1.3+ nightlies 
>            Reporter: Kay Kay
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: NLProfile.java, SOLR-912.patch, SOLR-912.patch
>
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> The implementation of NamedList - while being fast - is not necessarily 
> type-safe. I have implemented an additional implementation of the same - 
> ModernNamedList (a type-safe variation providing the same interface as 
> NamedList) - while preserving the semantics in terms of ordering of elements 
> and allowing null elements for key and values (keys are always Strings , 
> while values correspond to generics ). 

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

Reply via email to