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

Robert Ragno commented on LUCENE-3281:
--------------------------------------

Ah, good point. It seems cleaner to maintain it (which is straightforward). The 
other sensible alternative would be to make the asserts all refer to the 
up-rounded capacity. However, it seems reasonable and consistent to have an OBS 
present the capacity it was constructed with.

I suppose there is room to split capacity() and size(), but that might confuse 
existing uses.

Incidentally, if it were open to behavioral changes... I would find it more 
convenient if the asserts were replaced with assuming that the vector was 
infinite, filled with zeros. This seems more consistent with the set 
operations, anyway. And the union operation, and so on. (And it is not as if 
anyone can properly be relying on the current asserts to control flow.)

> OpenBitSet should report the configured capacity/size
> -----------------------------------------------------
>
>                 Key: LUCENE-3281
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3281
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/other
>    Affects Versions: 3.0, 3.0.1, 3.0.2, 3.0.3, 3.1, 3.2
>            Reporter: Robert Ragno
>            Priority: Minor
>   Original Estimate: 2m
>  Remaining Estimate: 2m
>
> OpenBitSet rounds up the capacity() to the next multiple of 64 from what was 
> specified. However, this is particularly damaging with the new asserts, which 
> trigger when anything above the specified capacity is used as an index. The 
> simple fix is to return numBits for capacity().

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to