Lucene - Core
  1. Lucene - Core
  2. LUCENE-5272

OpenBitSet.ensureCapacity does not modify numBits

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, Trunk
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      It's a simple bug, reproduced by this simple test:

        public void testEnsureCapacity() {
          OpenBitSet bits = new OpenBitSet(1);
          bits.fastSet(0);
          bits.ensureCapacity(5); // make room for more bits
          bits.fastSet(2);
        }
      

      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.

      1. LUCENE-5272.patch
        4 kB
        Shai Erera
      2. LUCENE-5272.patch
        7 kB
        Shai Erera

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Shai Erera
            Reporter:
            Shai Erera
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development