sourcesmith / compressedbitset

Automatically exported from code.google.com/p/compressedbitset
1 stars 0 forks source link

WAHIterator.next() yields ArrayIndexOutOfBoundsException #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a compressed bitset
2. try to iterate over it using the WAHIterator

What version of the product are you using? On what operating system?
0.1

Please provide any additional information below.
WAHIterator.next() calls nextDoc and an ArrayIndexOutOfBoundsException gets
thrown at pos[pos_idx++];

Apparently pos has length 0, pos_idx is 0. The current word is marked as
being a non-range word, but it doesn't contain any indices?

Original issue reported on code.google.com by S.J.vanS...@gmail.com on 1 Apr 2010 at 10:52

GoogleCodeExporter commented 8 years ago
Seems to be caused by cardinality() returning an invalid value, but not yet 
sure...

Original comment by S.J.vanS...@gmail.com on 1 Apr 2010 at 2:07

GoogleCodeExporter commented 8 years ago
Indeed: forcing cardinality() to do a recount every time fixes the problem. It 
seems
to only occur after this sequence of events:

1) computing the logical or of two sets
2) appending a 1-bit at the end of the bit set, requiring a new active word

I'm not familiar enough with the source code to actually provide a better fix 
can
calling 'doCount' every time.

Original comment by S.J.vanS...@gmail.com on 1 Apr 2010 at 4:26