Skip to content

InstantPatternLegacyFormatter computes precision incorrectly #3816

@vy

Description

@vy

InstantPatternLegacyFormatter uses InstantPatternDynamicFormatter to determine the precision of the legacy date & time pattern it receives. As reported by @ppkarwasz (see the review discussion), this results in incorrect precision (i.e., microseconds are currently classified as nanoseconds), and hence, causes incorrect cache invalidation.

In 3799799, @ppkarwasz fixes this by converting the legacy pattern back to DateTimeFormatter-compatible (i.e., modern) variant before passing it to InstantPatternDynamicFormatter. I am personally in favor of copying InstantPatternDynamicFormatter::patternPrecision to InstantPatternLegacyFormatter, and adapting it, since this will ensure legacy code remains an island.

Metadata

Metadata

Assignees

Labels

bugIncorrect, unexpected, or unintended behavior of existing codelayoutsAffects one or more Layout plugins

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions