Suggestion: Add the method isEmpty in the classes StringBuilder and StringBuffer

Vitaly Davidovich vitalyd at gmail.com
Mon Feb 11 14:34:09 UTC 2013


It won't replace them in loops or at least not entirely (may get
intermediate builders for each iteration).

I also agree on the isEmpty() point.

Sent from my phone
On Feb 11, 2013 9:30 AM, "Ulf Zibis" <Ulf.Zibis at cosoco.de> wrote:

> Am 11.02.2013 12:54, schrieb Hildeberto Mendonça:
>
>> Hello,
>>
>> we have a scenario where a project with approximately 500K lines of code
>> is
>> going through a large refactoring. One of the changes was to replace
>> string
>> concatenations in loops by StringBuilder.
>>
>
> Are you aware, that behind the scenes, String concatenations are
> automatically internally replaced from javac by StringBuilder invocations,
> so in the end you might have less readable code, which is still not faster
> than before.
>
>  Having shown that, we would like to know if there was a previous discution
>> on the inclusion or not of a method isEmpty in the StringBuilder.
>>
>
> +1 anyway
>
> -Ulf
>
>



More information about the core-libs-dev mailing list