<div class="__aliyun_email_body_block"><div  style="font-family: Tahoma, Arial, STHeitiSC-Light, SimSun"><div  style="clear: both;"><span >Hello everyone,</span></div><div  style="clear: both;"><br ><div  style="clear: both;">I'd like to introduce a set of changes focused on optimizing the formatting of two-digit numbers within date and time formatting.</div><div  style="clear: both;">These changes introduce a new internal API, DecimalDigits.appendPair, designed for efficiently appending integers in the range 00-99 to a StringBuilder. This API is exposed for internal use via JavaLangAccess and is leveraged in DateTimeHelper to refactor the formatting logic for date and time components (month, day, hour, minute, second), aiming to improve both code clarity and performance.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">The specific changes are as follows:</div><div  style="clear: both;"> 1. Introduce `appendPair` method:</div><div  style="clear: both;">     * Added the core implementation appendPair(int i) to AbstractStringBuilder.</div><div  style="clear: both;">     * Provided internal access bridges via JavaLangAccess and System.JavaLangAccessImpl.</div><div  style="clear: both;">     * Added a public static utility method appendPair(StringBuilder, int) in DecimalDigits.</div><div  style="clear: both;"> 2. Refactor `DateTimeHelper` to use `appendPair`:</div><div  style="clear: both;">     * Updated DateTimeHelper.formatTo methods for LocalDate and LocalTime to utilize the new DecimalDigits.appendPair for formatting month, day, hour, minute, and second components.</div><div  style="clear: both;"> 3. Optimize year formatting:</div><div  style="clear: both;">     * Slightly refactored the year formatting logic to use subtraction instead of the modulo operation for calculating the lower two digits, which can offer a minor performance gain. A comment was added to clarify the safety of the input range for DecimalDigits.appendPair.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">A draft PR containing these changes is now available at: <a  href="https://github.com/openjdk/jdk/pull/26911" target="_blank">https://github.com/openjdk/jdk/pull/26911</a></div><div  style="clear: both;">Your review and feedback would be greatly appreciated.</div><div  style="clear: both;"><br ></div><div  style="clear: both;">Thank you!</div><div  style="clear: both;"><br ></div><div  style="clear: both;">-</div><span >Shaojin Wen</span></div></div></div>