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).

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`.

This line of reasoning seems to be superfluous. JavaFX is not supported at all 
on JDKs where LocalDate[Time] is not available (pre-JDK 8).

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2361#discussion_r4616419832

Reply via email to