RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v2]
Raffaello Giulietti
rgiulietti at openjdk.org
Thu Feb 23 18:26:09 UTC 2023
On Thu, 23 Feb 2023 17:39:10 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>> Add the ability to repeatedly append char and CharSequence data to StringBuilder/StringBuffer.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>
> PR Cleanup
src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1850:
> 1848: boolean isLatin1 = isLatin1();
> 1849: if (isLatin1 && StringLatin1.canEncode(c)) {
> 1850: while (index < limit) {
while (index != limit) {
is probably safer, in particular if `limit` has overflown to `Integer.MIN_VALUE`.
Not sure if this could happen, but...
-------------
PR: https://git.openjdk.org/jdk/pull/12728
More information about the core-libs-dev
mailing list