Issue Details (XML | Word | Printable)

Key: LUCENE-1163
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Michael McCandless
Reporter: Thomas Peuss
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

CharArraySet.contains(char[] text, int off, int len) does not work

Created: 05/Feb/08 01:18 PM   Updated: 11/Oct/08 12:49 PM
Return to search
Component/s: None
Affects Version/s: 2.3
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works CharArraySetShowBug.java 2008-02-05 01:20 PM Thomas Peuss 0.6 kB
Text File Licensed for inclusion in ASF works LUCENE-1163.patch 2008-02-05 01:44 PM Michael McCandless 3 kB

Lucene Fields: New
Resolution Date: 05/Feb/08 02:04 PM


 Description  « Hide
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

if (set.contains(buffer,offset,length) {
  ...
}

my code fails.

But when I do

if (set.contains(new String(buffer,offset,length)) {
   ...
}

everything works as expected.

Both variants should behave the same. I attach a small piece of code to show the problem.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Thomas Peuss made changes - 05/Feb/08 01:20 PM
Field Original Value New Value
Attachment CharArraySetShowBug.java [ 12374771 ]
Michael McCandless made changes - 05/Feb/08 01:38 PM
Assignee Michael McCandless [ mikemccand ]
Michael McCandless made changes - 05/Feb/08 01:44 PM
Attachment LUCENE-1163.patch [ 12374772 ]
Michael McCandless made changes - 05/Feb/08 02:04 PM
Resolution Fixed [ 1 ]
Fix Version/s 2.4 [ 12312681 ]
Status Open [ 1 ] Resolved [ 5 ]
Michael McCandless made changes - 11/Oct/08 12:49 PM
Status Resolved [ 5 ] Closed [ 6 ]