lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-1163) CharArraySet.contains(char[] text, int off, int len) does not work
Date Tue, 12 Feb 2008 11:25:08 GMT

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

Michael McCandless commented on LUCENE-1163:
--------------------------------------------

Backported to 2.3

> CharArraySet.contains(char[] text, int off, int len) does not work
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1163
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1163
>             Project: Lucene - Java
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Thomas Peuss
>            Assignee: Michael McCandless
>             Fix For: 2.4
>
>         Attachments: CharArraySetShowBug.java, LUCENE-1163.patch
>
>
> I try to use the CharArraySet for a filter I am writing. I heavily use char-arrays in
my code to speed up things. I stumbled upon a bug in CharArraySet while doing that.
> The method _public boolean contains(char[] text, int off, int len)_ seems not to work.
> When I do 
> {code}
> if (set.contains(buffer,offset,length) {
>   ...
> }
> {code}
> my code fails.
> But when I do
> {code}
> if (set.contains(new String(buffer,offset,length)) {
>    ...
> }
> {code}
> everything works as expected.
> Both variants should behave the same. I attach a small piece of code to show the problem.

-- 
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


Mime
View raw message