On Fri, 19 Dec 2025 21:42:14 GMT, Roger Riggs <[email protected]> wrote:

> This version isn't well encapsulated and has changes across multiple files. 
> What was suggested at the beginning of December is prototyped in PR #28936.

1. Using exceptions for logic control seems like a bad practice.

2. A DateTimeFormatter is reused multiple times. Our approach of calculating 
`onlyChronoField` only runs once during construction. However, using a runtime 
approach with `try-catch ClassCastException` executes the corresponding code 
every time `parse` is called. This is a choice between executing once and 
executing multiple times.

3. In the `DateTimeFormatter::checkField` method, we could later add an `int 
chronoFieldBitSet` field to record which ChronoFields are used. This could 
further optimize other methods of `Parsed`.

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

PR Comment: https://git.openjdk.org/jdk/pull/28471#issuecomment-3677403633

Reply via email to