<i18n dev> RFR: JDK-8316435: sun.util.calendar.CalendarSystem subclassing should be restricted [v4]
Naoto Sato
naoto at openjdk.org
Tue Sep 19 23:10:40 UTC 2023
On Tue, 19 Sep 2023 21:10:18 GMT, Justin Lu <jlu at openjdk.org> 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
More information about the i18n-dev
mailing list