[
https://issues.apache.org/jira/browse/LUCENE-5272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13793686#comment-13793686
]
Shai Erera commented on LUCENE-5272:
------------------------------------
I don't think we need to deprecate anything as there's no way anyone relies on
these methods and his app works (setNumWords, length etc.). I am also thinking
of a new GrowableBitSet which relaxes all bounds checks and puts the
responsibility on the app to call grow()/ensureCapacity(). This will also get
rid of the duplicate methods (set/fastSet, get/fastSet etc.).
Unfortunately we cannot modify OBS to relax bound checks because that's a
serious backwards break. But perhaps we can completely deprecate it in favor of
the new bitset.
> OpenBitSet.ensureCapacity does not modify numBits
> -------------------------------------------------
>
> Key: LUCENE-5272
> URL: https://issues.apache.org/jira/browse/LUCENE-5272
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/index
> Reporter: Shai Erera
> Attachments: LUCENE-5272.patch
>
>
> It's a simple bug, reproduced by this simple test:
> {code}
> public void testEnsureCapacity() {
> OpenBitSet bits = new OpenBitSet(1);
> bits.fastSet(0);
> bits.ensureCapacity(5); // make room for more bits
> bits.fastSet(2);
> }
> {code}
> The problem is that {{numBits}} which is used only for assrets isn't modified
> by ensureCapacity and so the next fastSet trips the assert. I guess we should
> also fix ensureCapacityWords and test it too.
> I may not be able to fix this until Sunday though, so if anyone wants to fix
> it before (maybe it can make it into 4.5.1), feel free.
--
This message was sent by Atlassian JIRA
(v6.1#6144)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]