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
No work has yet been logged on this issue.