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

Slightly more readable code in Token/TermAttributeImpl

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 2.9
    • 2.9
    • modules/analysis
    • None
    • New, Patch Available

    Description

      No big deal.

      growTermBuffer(int newSize) was using correct, but slightly hard to follow code.

      the method was returning null as a hint that the current termBuffer has enough space to the upstream code or reallocated buffer.

      this patch simplifies logic making this method to only reallocate buffer, nothing more.
      It reduces number of if(null) checks in a few methods and reduces amount of code.
      all tests pass.

      This also adds tests for the new basic attribute impls (copies of the Token tests).

      Attachments

        1. LUCENE-1762.patch
          25 kB
          Uwe Schindler
        2. LUCENE-1762-bw.patch
          0.8 kB
          Uwe Schindler
        3. LUCENE-1762.patch
          23 kB
          Uwe Schindler
        4. LUCENE-1762.patch
          11 kB
          Eks Dev
        5. LUCENE-1762.patch
          10 kB
          Eks Dev
        6. LUCENE-1762.patch
          4 kB
          Eks Dev

        Activity

          People

            uschindler Uwe Schindler
            eksdev Eks Dev
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: