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

Replace StringBuffer with StringBuilder

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 5.1
    • Fix Version/s: None
    • Labels:
      None
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      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

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

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: