[ 
https://issues.apache.org/jira/browse/LUCENE-2195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12801252#action_12801252
 ] 

Simon Willnauer commented on LUCENE-2195:
-----------------------------------------

bq. I do not think unmodifiableset should have a no-arg ctor, so instead i 
pushed this up to emptychararrayset
ok I'm fine with that.

{quote}
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.
{quote}

You are right, this should only throw this exception if the set contains it and 
the Iterator does not implement remove()
{code}
     * Note that this implementation throws an
     * <tt>UnsupportedOperationException</tt> if the iterator returned by this
     * collection's iterator method does not implement the <tt>remove</tt>
     * method and this collection contains the specified object.
{code}

same is true for AbstractSet#removeAll()  & retainAll()

Thanks for updating it. I think this is good to go though! 



> 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: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to