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

Replace StringBuffer with StringBuilder where possible, add to forbidden-apis

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.7, 6.0
    • core/index
    • None
    • Patch Available

    Description

      This is pretty minor, but I found a few issues with the toString implementations while looking through the facet data structures.

      The most egregious is the use of string concatenation in the IntArray class. I have fixed that using StringBuilders. I also noticed that other classes were using StringBuffer instead of StringBuilder. According to the javadoc,

      "This class is designed for use as a drop-in replacement for StringBuffer in places where the string buffer was being used by a single thread (as is generally the case). Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations."

      Attachments

        1. 5372.patch
          7 kB
          Joshua Hartman
        2. 5372-lucene5339.patch
          32 kB
          Joshua Hartman
        3. 5372-v2.patch
          39 kB
          Joshua Hartman
        4. LUCENE-5372-forbidden.patch
          0.8 kB
          Uwe Schindler
        5. LUCENE-5372-StringBuffer.patch
          33 kB
          Uwe Schindler

        Activity

          People

            uschindler Uwe Schindler
            jhartman Joshua Hartman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: