Propose to make j.t.f.DateTimePrintContext immutable
wenshao
shaojin.wensj at alibaba-inc.com
Fri Sep 19 01:16:37 UTC 2025
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.
In order to make it easier for reviewers to see my ideas, I submitted a draft Pull Request ( https://github.com/openjdk/jdk/pull/26913 <https://github.com/openjdk/jdk/pull/26913 > ). Please give me feedback.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20250919/1dc90079/attachment.htm>
More information about the core-libs-dev
mailing list