Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-779

Provide a StrBuilder-based or StringBuilder-based ToStringBuilder

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: Patch Needed
    • Component/s: lang.builder.*
    • Labels:
      None

      Description

      At the moment, ToStringBuilder internally uses a StringBuffer to create the output String. StringBuffer, as opposed to StringBuilder and StrBuilder, is synchronized. Since ToStringBuilder will almost never leave the toString()-method, the synchronization only adds overhead.

      Since the ToStringBuilder API never suggests that ToStringBuilder is thread-safe, either the current implementation could be changed to use Str[ing]Builder or an alternative implementation could be provided.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                sdierl Simon Dierl
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: