You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2013/10/10 07:23:42 UTC

[jira] [Created] (LUCENE-5272) OpenBitSet.ensureCapacity does not modify numBits

Shai Erera created LUCENE-5272:
----------------------------------

             Summary: 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


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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org