RFR: JDK-8302323 Add repeat methods to StringBuilder/StringBuffer [v3]

Alan Bateman alanb at openjdk.org
Tue Feb 28 10:57:11 UTC 2023


On Mon, 27 Feb 2023 13:30:47 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:
> 
>   Optimize for empty CharSequence

src/java.base/share/classes/java/lang/AbstractStringBuilder.java line 1837:

> 1835:      * @since 21
> 1836:      * @throws IllegalArgumentException  if {@code count} is less than zero
> 1837:      * @throws IndexOutOfBoundsException  if the result overflows the buffer

IOOBE is for cases when an index is out of range so maybe that should be looked at again.

-------------

PR: https://git.openjdk.org/jdk/pull/12728


More information about the core-libs-dev mailing list