Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-308

Replace StringBuffer with StringBuilder

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Invalid
    • Minor
    • None
    • 5.1
    • None
    • N/A
    • N/A

    Description

      I’ve noticed that there’s StringBuffer used in most classes instead of StringBuilder. Is there any reason for that? StringBuffer is much slower than StringBuilder due to synchronization, it should be used only when shared between threads. See http://stackoverflow.com/questions/355089/stringbuilder-and-stringbuffer-in-java

      Simply use StringBuilder unless you really are trying to share a buffer between threads. StringBuilder is the unsynchronized (less overhead = more efficient) younger brother of the original synchronized StringBuffer class.

      Attachments

        Activity

          People

            vmassol Vincent Massol
            jirutka Jakub Jirutka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: