On Sat, 7 Nov 2026 16:53:14 GMT, Nir Lisker <[email protected]> wrote:
> Follow-up to #1880. Adds deprecation warnings, `@throws` tags, and leftover > fixes. > > The rethrowing we have on parsing methods is inconsistent. The > `BaseTemporalStringConverter`s don't rethrow and instead the exception is > naturally propagated. `DateTimeStringConverter`s and `NumberStringConverter`s > rethrow parsing exceptions as IAE. `FormatStringConverter` throws an IAE on > partial parsing, but not on a failed parsing (that doesn't throw naturally > either). > > I think that rethrowing parsing exceptions as IAE isn't helpful. The original > exception will propagate up the stack and be clear to the developer at least > as well as the rethrown IAE in my opinion. The only case where I would throw > is in the `FormatStringConverter` where an exception isn't thrown and `null` > is returned instead. Throwing on a partial parse is debatable. > > The commits help break up the changes. > > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Some comments on the docs. modules/javafx.base/src/main/java/javafx/util/converter/DateStringConverter.java line 36: > 34: /// @since JavaFX 2.1 > 35: /// @deprecated Prefer [LocalDateStringConverter] in JDK versions where > [java.time.LocalDate] is available as a > 36: /// replacement for `Date`. Suggestion: /// @deprecated Use [LocalDateStringConverter] instead. modules/javafx.base/src/main/java/javafx/util/converter/DateTimeStringConverter.java line 39: > 37: /// @since JavaFX 2.1 > 38: /// @deprecated Prefer [LocalDateTimeStringConverter] in JDK versions > where [java.time.LocalDateTime] is available as a > 39: /// replacement for `Date`. Suggestion: /// @deprecated Use [LocalDateTimeStringConverter] instead. modules/javafx.base/src/main/java/javafx/util/converter/TimeStringConverter.java line 36: > 34: /// @since JavaFX 2.1 > 35: /// @deprecated Prefer [LocalTimeStringConverter] in JDK versions where > [java.time.LocalTime] is available as a > 36: /// replacement for `Date`. Suggestion: /// @deprecated Use [LocalTimeStringConverter] instead. ------------- PR Review: https://git.openjdk.org/jfx/pull/2361#pullrequestreview-5976282423 PR Review Comment: https://git.openjdk.org/jfx/pull/2361#discussion_r4629684067 PR Review Comment: https://git.openjdk.org/jfx/pull/2361#discussion_r4629694224 PR Review Comment: https://git.openjdk.org/jfx/pull/2361#discussion_r4629731735
