RFR: 8375016: Several catch blocks for NullPointerExceptions exist in the codebase [v2]

Andy Goryachev angorya at openjdk.org
Mon Jan 12 19:38:01 UTC 2026


On Mon, 12 Jan 2026 18:00:47 GMT, Christopher Schnick <duke at openjdk.org> wrote:

>> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 5187:
>> 
>>> 5185:             } else {
>>> 5186:                 Integer result = slowMap.get(id);
>>> 5187:                 if (result == null) {
>> 
>> I don't think this is an equivalent change
>
> I don't see the issue with this one though. The NPE can only occur if the null result is unboxed, right? The get function itself should not throw an exception

you are right, `slowMap` is always initialized and a NPE can come only from unboxing.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2032#discussion_r2683339796


More information about the openjfx-dev mailing list