On Mon, 12 Jan 2026 14:11:48 GMT, Christopher Schnick <[email protected]> wrote:
> This PR replaces various catch blocks for NPEs by proper null checks. It
> looks like a lot but most of the binding changes are just variants of the
> same approach. The test cases have been adapted to not check for NPEs anymore.
>
> The PrismFontFactory change to a RuntimeException was made because I don't
> see how the try block can throw an NPE.
modules/javafx.base/src/main/java/javafx/beans/binding/Bindings.java line 7478:
> 7476: return val;
> 7477: } else {
> 7478: Logging.getLogger().fine("Element not found in map,
> returning default value instead.");
Why did you add this check? The old implementation doesn't check whether the
mapping exists, it simply returns the result of `Map.get()`.
On the other hand, `NullPointerException` is thrown by `Map.get()` if the key
is null, and the map doesn't permit null keys. The old implementation would
return null here end emit a warning, this implementation returns by throwing
the exception.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2032#discussion_r2683060660