On Sun, 11 Aug 2024 10:13:12 GMT, Shaojin Wen <d...@openjdk.org> wrote:

>> By removing the redundant code logic in 
>> DateTimeFormatterBuilder$InstantPrinterParser#formatTo, the codeSize can be 
>> reduced and the performance can be improved.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update 
> src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
>   
>   Co-authored-by: Stephen Colebourne <scolebou...@joda.org>

A more productive direction might be to move `LocalDate.formatTo` and 
`LocalTime.formatTo` to a JDK internal class (eg. in `jdk.internal.util`?), and 
then edit `LocalTime.formatTo` to handle `fractionalDigits` directly as another 
method parameter. This would allow the formatters in `DateTimeFormatterBuilder` 
to directly use the `formatTo` methods without adding any new public APIs.

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

PR Comment: https://git.openjdk.org/jdk/pull/20353#issuecomment-2282706467

Reply via email to