You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Robert Muir (JIRA)" <ji...@apache.org> on 2009/12/23 19:10:29 UTC

[jira] Created: (LUCENE-2179) CharArraySet.clear()

CharArraySet.clear()
--------------------

                 Key: LUCENE-2179
                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
             Project: Lucene - Java
          Issue Type: Improvement
          Components: Analysis
            Reporter: Robert Muir
            Priority: Minor
             Fix For: 3.1


I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.

instead I ended up using CharArrayMap<Boolean> because it supported .clear()

it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.

In Solr, the very similar CharArrayMap.clear() looks like this:
{code}
  @Override
  public void clear() {
    count = 0;
    Arrays.fill(keys,null);
    Arrays.fill(values,null);
  }
{code}

I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet

will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Updated: (LUCENE-2179) CharArraySet.clear()

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler updated LUCENE-2179:
----------------------------------

    Attachment: LUCENE-2179.patch

Patch for clear() and modified test. The test already checks, that the unmodifiable set cannot be cleared.

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Assigned: (LUCENE-2179) CharArraySet.clear()

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler reassigned LUCENE-2179:
-------------------------------------

    Assignee: Uwe Schindler

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Commented: (LUCENE-2179) CharArraySet.clear()

Posted by "Simon Willnauer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794162#action_12794162 ] 

Simon Willnauer commented on LUCENE-2179:
-----------------------------------------

patch looks good uwe! +1  from my side

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Commented: (LUCENE-2179) CharArraySet.clear()

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794218#action_12794218 ] 

Uwe Schindler commented on LUCENE-2179:
---------------------------------------

For this to work, in BW branch the clear() test will be disabled.

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Commented: (LUCENE-2179) CharArraySet.clear()

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12794208#action_12794208 ] 

Uwe Schindler commented on LUCENE-2179:
---------------------------------------

I will commit this together with LUCENE-2169.

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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


[jira] Resolved: (LUCENE-2179) CharArraySet.clear()

Posted by "Uwe Schindler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-2179?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uwe Schindler resolved LUCENE-2179.
-----------------------------------

       Resolution: Fixed
    Lucene Fields: [New, Patch Available]  (was: [New])

Committed revision: 893655

> CharArraySet.clear()
> --------------------
>
>                 Key: LUCENE-2179
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2179
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Analysis
>            Reporter: Robert Muir
>            Assignee: Uwe Schindler
>            Priority: Minor
>             Fix For: 3.1
>
>         Attachments: LUCENE-2179.patch
>
>
> I needed CharArraySet.clear() for something I was working on in Solr in a tokenstream.
> instead I ended up using CharArrayMap<Boolean> because it supported .clear()
> it would be better to use a set though, currently it will throw UOE for .clear() because AbstractSet will call iterator.remove() which throws UOE.
> In Solr, the very similar CharArrayMap.clear() looks like this:
> {code}
>   @Override
>   public void clear() {
>     count = 0;
>     Arrays.fill(keys,null);
>     Arrays.fill(values,null);
>   }
> {code}
> I think we can do a similar thing as long as we throw UOE for the UnmodifiableCharArraySet
> will submit a patch later tonight (unless someone is bored and has nothing better to do)

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