[ 
https://issues.apache.org/jira/browse/LUCENENET-301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12781348#action_12781348
 ] 

Nicholas Paldino edited comment on LUCENENET-301 at 11/23/09 9:53 AM:
----------------------------------------------------------------------

The MyHitCollector class uses a BitArray with a length of 64.  However, 
documents with an id of over 63 are used as indexes to set the bit in the 
BitArray, which causes an exception.

In Java, the BitSet class would be used, and the set would grow automatically 
to accomidate the new bits.

I fixed the test to simply increase the length of the bit array to make sure it 
has the capacity before setting the bit using the document id.

Now all the tests mentioned in the original issue statement pass.

It should be noted that a class which emulates the BitSet to use as a 
replacement for BitArray would be preferable at some point to encapsulate the 
code that handles the growth of the BitSet.

      was (Author: casperone):
    The MyHitCollector class uses a BitArray with a length of 64.  However, 
documents with an id of over 63 are used as indexes to set the bit in the 
BitArray, which causes an exception.

In Java, the BitSet class would be used, and the set would grow automatically 
to accomidate the new bits.

I fixed the test to simply increase the length of the bit array to make sure it 
has the capacity before setting the bit using the document id.

Now all the tests mentioned in the original issue statement pass.

It should be noted that a class which emulates the BitSet to use as a 
replacement for BitArray would be preferable at some point to encapsulate the 
growth.
  
> Tests on TestTimeLimitedCollector fail
> --------------------------------------
>
>                 Key: LUCENENET-301
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-301
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Nicholas Paldino
>         Attachments: TestTimeLimitedCollector.patch
>
>
> The tests on TestTimeLimitedCollector fail:
> - TestSearch
> - TestSearchMultiThreaded
> - TestTimeoutGreedy
> - TestTimeoutMultiThreaded
> - TestTimeoutNotGreedy
> Patch to follow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to