Lucene - Core
  1. Lucene - Core
  2. LUCENE-2830

Use StringBuilder instead of StringBuffer in benchmark

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: modules/benchmark
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      Minor change - use StringBuilder instead of StringBuffer in benchmark's code. We don't need the synchronization of StringBuffer in all the places that I've checked.

      The only place where it could be a problem is in HtmlParser's API - one method accepts a StringBuffer and it's an interface. But I think it's ok to change benchmark's API, back-compat wise and so I'd like to either change it to accept a String, or remove the method altogether – no code in benchmark uses it, and if anyone needs it, he can pass StringReader to the other method.

      1. LUCENE-2830.patch
        21 kB
        Shai Erera
      2. LUCENE-2830.patch
        20 kB
        Shai Erera

        Activity

        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1
        Hide
        Shai Erera added a comment -

        Committed revision 1052180 (3x).
        Committed revision 1052182 (trunk).

        Show
        Shai Erera added a comment - Committed revision 1052180 (3x). Committed revision 1052182 (trunk).
        Hide
        Shai Erera added a comment -

        Since parse(*, StringBuffer, *) is not used, and whoever wants to use it can use the Reader variant and pass new StringReader(), I removed it.

        I plan to commit tomorrow.

        Show
        Shai Erera added a comment - Since parse(*, StringBuffer, *) is not used, and whoever wants to use it can use the Reader variant and pass new StringReader(), I removed it. I plan to commit tomorrow.
        Hide
        Shai Erera added a comment -

        Patch replaces StringBuffer with StringBuilder. I did not yet remove the parse() method from HtmlParser - if people are ok with it, I'll remove it. For now, I changed the parameter to String.

        All tests pass.

        Show
        Shai Erera added a comment - Patch replaces StringBuffer with StringBuilder. I did not yet remove the parse() method from HtmlParser - if people are ok with it, I'll remove it. For now, I changed the parameter to String. All tests pass.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development