Component: GEF FX
Severity: Regression (broken on JavaFX 25)
Summary
A NullPointerException occurs in ExpressionHelper.fireValueChangedEvent during mouse-wheel zoom whenever a Connection carries volatile control-point anchors (i.e. anchors inserted by an AbstractRouter subclass). The crash is a regression introduced by JavaFX 25 (or before, presumably by a change in ExpressionHelper).
Stack trace (abridged):
java.lang.NullPointerException
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:386)
at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(...)
at javafx.beans.property.ObjectPropertyBase.set(...)
at org.eclipse.gef.zest.fx.behaviors.ConnectionClickableAreaBehavior (stroke-width change)
Root cause:
In org.eclipse.gef.mvc.fx.behaviors.ConnectionClickableAreaBehavior 'scaleXListener' is a manual invalidation workaround that can trigger re-entrant invalidate() calls during lifecycle transitions which cause the NPE.
Reproducer:
Create a Connection that is routed by a custom AbstractRouter subclass which inserts and removes several VolatileStaticAnchor control points on each routing pass.
Trigger several re-routes (e.g. by resizing the window or panning the canvas).
Scroll the mouse wheel to zoom.
→ NPE at ExpressionHelper.java:386.
Suggested fix:
Consider binding the DoubleBinding directly to mxxProperty() and removing the explicit listener.
Also unbind clickableAreaWidthProperty() before disposing the binding in doDeactivate().
Environment:
- GEF version: 5.5.1
- JavaFX version: 25
- Java version: 25
- OS: Windows
Note: I encountered the NPE - all the technical analysis (including a workaround for me) and a draft for this issue report was done by GitHub Copilot (no adverstising, just to let you know).
Component: GEF FX
Severity: Regression (broken on JavaFX 25)
Summary
A NullPointerException occurs in ExpressionHelper.fireValueChangedEvent during mouse-wheel zoom whenever a Connection carries volatile control-point anchors (i.e. anchors inserted by an AbstractRouter subclass). The crash is a regression introduced by JavaFX 25 (or before, presumably by a change in ExpressionHelper).
Stack trace (abridged):
java.lang.NullPointerException
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:386)
at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(...)
at javafx.beans.property.ObjectPropertyBase.set(...)
at org.eclipse.gef.zest.fx.behaviors.ConnectionClickableAreaBehavior (stroke-width change)
Root cause:
In org.eclipse.gef.mvc.fx.behaviors.ConnectionClickableAreaBehavior 'scaleXListener' is a manual invalidation workaround that can trigger re-entrant invalidate() calls during lifecycle transitions which cause the NPE.
Reproducer:
Create a Connection that is routed by a custom AbstractRouter subclass which inserts and removes several VolatileStaticAnchor control points on each routing pass.
Trigger several re-routes (e.g. by resizing the window or panning the canvas).
Scroll the mouse wheel to zoom.
→ NPE at ExpressionHelper.java:386.
Suggested fix:
Consider binding the DoubleBinding directly to mxxProperty() and removing the explicit listener.
Also unbind clickableAreaWidthProperty() before disposing the binding in doDeactivate().
Environment:
Note: I encountered the NPE - all the technical analysis (including a workaround for me) and a draft for this issue report was done by GitHub Copilot (no adverstising, just to let you know).