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

Robert Muir updated LUCENE-2195:
--------------------------------

    Attachment: LUCENE-2195.patch

Simon i made a few changes (i like the idea of simply a special 
EmptyCharArraySet so this does not slow down anything else and alleviates any 
concerns)

* I do not think unmodifiableset should have a no-arg ctor, so instead i pushed 
this up to emptychararrayset
* i do not think emptychararrayset need override and throw uoe for removeAll or 
retainAll, and i don't think the tests were correct in assuming it will throw 
uoe. it will not throw uoe for say, removeAll only because it is empty. it will 
just do nothing.

now the emptychararrayset conforms with AbstractCollation.remove/retainAll:
Note that this implementation will throw an UnsupportedOperationException if 
the iterator returned by the iterator method does not implement the remove 
method and this collection contains one or more elements in common with/not 
present with the specified collection.


> Speedup CharArraySet if set is empty
> ------------------------------------
>
>                 Key: LUCENE-2195
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2195
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Simon Willnauer
>            Assignee: Robert Muir
>             Fix For: 3.1
>
>         Attachments: LUCENE-2195.patch, LUCENE-2195.patch, LUCENE-2195.patch, 
> LUCENE-2195.patch
>
>
> CharArraySet#contains(...) always creates a HashCode of the String, Char[] or 
> CharSequence even if the set is empty. 
> contains should return false if set it empty

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


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

Reply via email to