On Tue, 19 Sep 2023 21:10:18 GMT, Justin Lu <[email protected]> wrote:
>> src/java.base/share/classes/sun/util/calendar/CalendarUtils.java line 132:
>>
>>> 130: * Mimics sprintf(buf, "%0*d", decaimal, width).
>>> 131: */
>>> 132: public static StringBuilder sprintf0d(StringBuilder sb, int value,
>>> int width) {
>>
>> Can this (and the following overload) method be eliminated? No need to mimic
>> `sprintf` here, but using `String.format`/`formatted` should suffice?
>
> Thanks for reviewing, replaced the two methods with Formatter (there are
> occurrences in _test_ as well)
Oh, I was not aware that the utility methods were used in `Date.toString()`. I
will have to take my suggestion back for performance reasons (assuming the
existing implementation is faster). Sorry for not noticing that beforehand.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15803#discussion_r1330789413