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

Uwe Schindler updated LUCENE-5640:
----------------------------------

    Attachment: LUCENE-5640.patch

Here is a (quite large) patch that refactors a bit more:
- Move AttributeSource.AttributeFactory to a top-level class (this makes most 
of the patch)
- Add a special AttributeFactory that can be used to implement factories that 
return a specific class instance for a set of attributes.
- In AttrbuteFactory cache the constructor instances of all AttributeImpls. 
This spares looking up the constructor in addAttribute(). The trick with 
SoftReference was inspired by the JDK. Theoretically, the reference may not be 
needed at all if impl and attribute are from same classloader..
- Factored out the basic attributes to PackedTokenAttributeImpl (no flags and 
payloads)
- Token got deprecated (yippee) and additionally implements FlagsAttribute and 
PayloadAttribute

> Cleanup Token class
> -------------------
>
>                 Key: LUCENE-5640
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5640
>             Project: Lucene - Core
>          Issue Type: Sub-task
>          Components: modules/analysis
>            Reporter: Uwe Schindler
>             Fix For: 4.9, 5.0
>
>         Attachments: LUCENE-5640.patch, LUCENE-5640.patch
>
>
> We should remove code duplication in the Token class:
> - copy constructors
> - reinit() shit
> - non-default clone()
> This is too bugy. Most of the methods can be simply removed. In fact, Token 
> should just look like a clone of all AttributeImpl it implements.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to