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

Provide a StrBuilder-based or StringBuilder-based ToStringBuilder

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1
    • Patch Needed
    • lang.builder.*
    • 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

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

              Dates

                Created:
                Updated: