Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3224

bugs in ByteArrayDataInput

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0-ALPHA
    • None
    • None
    • New

    Description

      ByteArrayDataInput has a byte[] ctor, but it doesn't actually work (some things like readVint will work, others will fail due to asserts).

      The problem is it doesnt set things like limit in the ctor... I think the ctor should call reset()
      Most code using this passes null to the ctor to initialize it, then uses reset(), instead they could just call ByteArrayInput(BytesRef.EMPTY_BYTES) if they want to do that.
      finally, reset()'s limit looks like it should be offset + len

      Attachments

        1. LUCENE-3224.patch
          8 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: