commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shevek (JIRA)" <>
Subject [jira] [Commented] (LANG-833) ToStringBuilder should use StringBuilder
Date Thu, 27 Sep 2012 15:44:07 GMT


Shevek commented on LANG-833:

The point of using StringBuilder is twofold: Firstly for performance; whoever needed a threadsafe
toString method, and anybody who does can synchronize themselves. It's not as if synchronization
within ToStringBuilder is capable of guarding access to an instance variable.

Secondly, for compatibility with existing APIs which are capable of appending to a java.lang.StringBuilder,
which is the majority, these days. That's the killer for me.
> ToStringBuilder should use StringBuilder
> ----------------------------------------
>                 Key: LANG-833
>                 URL:
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.1
>            Reporter: Shevek
> Rewriting as lang3 but still using StringBuffer (synchronized) looks like a missed opportunity.
Please use StringBuilder.
> Suggest audit for uses of StringBuffer in lang3 overall. No cause for it.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message