On Fri, 26 Sep 2025 04:04:40 GMT, Shaojin Wen <[email protected]> wrote:

>> I propose to make j.t.f.DateTimePrintContext immutable.
>> 
>> Currently, DateTimePrintContext has only one mutable field, optional. This 
>> can be replaced by adding an optional parameter to the 
>> DateTimeFormatter.formatTo method.
>> 
>> Immutable DateTimePrintContext can be optimized by escape analysis, such as 
>> immutable object optimization.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   add DateTimePrinterParser#withOptional, from @RogerRiggs

This has a much more invasive impact on PrinterParsers than the version with an 
extra argument on the format method.
Are there other implementations of the nested depth counter in 
DateTimePrinterContext?

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

PR Comment: https://git.openjdk.org/jdk/pull/26913#issuecomment-3339118873

Reply via email to