RFR: 8375070: NPE in Scene.ClickGenerator::preProcess when mouse button is none [v3]

Andy Goryachev angorya at openjdk.org
Mon Jan 12 23:54:39 UTC 2026


On Mon, 12 Jan 2026 23:51:14 GMT, Christopher Schnick <duke at openjdk.org> wrote:

>> A straightforward fix to just include MouseButton.NONE in the click counter map in cases weird mouse button events are sent. Alternatively, these events could also be ignored/dropped at some point
>
> Christopher Schnick has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Preserve original logic even more

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?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2034#discussion_r2684280627


More information about the openjfx-dev mailing list