RFR: 8299677: Formatter.format might take a long time to format an integer or floating-point
Jim Laskey
jlaskey at openjdk.org
Wed Jan 11 12:54:12 UTC 2023
On Wed, 11 Jan 2023 10:47:03 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:
> This change transforms a O(n^2) path to O(n) when prepending zero padding to decimal outputs, where n is the length of the padding.
Just as a note, I've been thinking about adding a `repeat(String src, int count)` method to AbstractStringBuffer for quite some. I've held off because I would add a `fillWith(T[] dst, T[] src, int start, int end)` methods to `java.util.Arrays` first. I think both sets of methods would be generally useful based on use patterns in the JDK but for time and motivation.
-------------
PR: https://git.openjdk.org/jdk/pull/11939
More information about the core-libs-dev
mailing list