RFR: 8375070: NPE in Scene.ClickGenerator::preProcess when mouse button is none [v3]
Christopher Schnick
duke at openjdk.org
Tue Jan 13 00:01:01 UTC 2026
On Mon, 12 Jan 2026 23:51:14 GMT, Christopher Schnick <duke at openjdk.org> wrote:
>> modules/javafx.graphics/src/main/java/javafx/scene/Scene.java line 3721:
>>
>>> 3719: if (! e.isBackButtonDown()) { counters.get(MouseButton.BACK).clear(); }
>>> 3720: if (! e.isForwardButtonDown()) { counters.get(MouseButton.FORWARD).clear(); }
>>> 3721: if (cc != null) {
>>
>> this looks far safer, though it's still unclear why this might happen. perhaps it's a problem with the test code and not the product?
>
> If I get this correctly, if an event with an unknown raw mouse button index is sent, then this will map it MouseButton.NONE and cc will be null: https://github.com/openjdk/jfx/blob/fd30c94893156644c0d803b3e7fd8c9731d65fe6/modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java#L234
I saw a comment to another issue in https://github.com/openjdk/jfx/blob/fd30c94893156644c0d803b3e7fd8c9731d65fe6/modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/GlassViewEventHandler.java#L302 but somehow I can't access it. So no idea what this was about
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2034#discussion_r2684295660
More information about the openjfx-dev
mailing list