[PATCH] Use StringJoiner where appropriate in java.base
Сергей Цыпанов
sergei.tsypanov at yandex.ru
Fri Jun 21 12:40:36 UTC 2019
> Yes, StringJoiner is really good at joining Strings (hence the name).
> But it is not very good at joining primitives. Because you have to
> convert each primitive to a String before you can add it.
> StringBuilder does not need to allocate a String when you add a
> primitive.
I've reworked my patch to affect only the spots where we either already have Strings
or do convertion to String (just like StringBuilder.append(Object) does using String::valueOf).
Also I've dropped erroneous changes to Atomic*Array (thanks Martin for spotting this).
Regards,
Sergey Tsypanov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-diff
Size: 20666 bytes
Desc: not available
URL: <https://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20190621/9fca4394/patch-0001.txt>
More information about the core-libs-dev
mailing list