<i18n dev> Integrated: 8368172: Make java.time.format.DateTimePrintContext immutable

Shaojin Wen swen at openjdk.org
Wed Oct 29 01:31:25 UTC 2025


On Sat, 23 Aug 2025 11:27:55 GMT, Shaojin Wen <swen at openjdk.org> 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.

This pull request has now been integrated.

Changeset: a588c120
Author:    Shaojin Wen <swen at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a588c120fc2ec9d5c59c43cda7f247e0a84981ff
Stats:     88 lines in 3 files changed: 9 ins; 32 del; 47 mod

8368172: Make java.time.format.DateTimePrintContext immutable

Reviewed-by: liach

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

PR: https://git.openjdk.org/jdk/pull/26913


More information about the i18n-dev mailing list