Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 519695

Summary: NullPointerException during shutdown while DotGraphView is open and a node is selected.
Product: [Tools] GEF Reporter: Tamas Miklossy <miklossy>
Component: GEF ZestAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 5.0.1 (Oxygen.1) RC1   
Hardware: All   
OS: All   
Whiteboard:

Description Tamas Miklossy CLA 2017-07-14 09:19:13 EDT
The NPE is thrown when the Dot Graph View is open, a node is selected, and the user shuts down the application.

The Exception is thrown due to the Scene#windowProperty being set to null, even though a bounds change is processed by GraphLayoutBehavior.

Unfortunately, the window change is propagated after the bounds change. Therefore, the bounds listener cannot be deactivated in response to window changes. That's why the window probably needs to be checked when processing a bounds change.
Comment 1 Tamas Miklossy CLA 2017-07-16 13:17:54 EDT
java.lang.NullPointerException
	at org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior.computeLayoutBounds(GraphLayoutBehavior.java:175)
	at org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior.updateBounds(GraphLayoutBehavior.java:353)
	at org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior$4.changed(GraphLayoutBehavior.java:84)
	at org.eclipse.gef.zest.fx.behaviors.GraphLayoutBehavior$4.changed(GraphLayoutBehavior.java:1)
	at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
	at javafx.beans.property.ReadOnlyObjectPropertyBase.fireValueChangedEvent(ReadOnlyObjectPropertyBase.java:74)
	at javafx.beans.property.ReadOnlyObjectWrapper.fireValueChangedEvent(ReadOnlyObjectWrapper.java:102)
	at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
	at javafx.beans.property.ObjectPropertyBase.access$000(ObjectPropertyBase.java:51)
	at javafx.beans.property.ObjectPropertyBase$Listener.invalidated(ObjectPropertyBase.java:233)
	at com.sun.javafx.binding.ExpressionHelper$SingleInvalidation.fireValueChangedEvent(ExpressionHelper.java:137)
	at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:81)
	at javafx.beans.binding.ObjectBinding.invalidate(ObjectBinding.java:172)
Comment 2 Tamas Miklossy CLA 2017-08-04 05:12:37 EDT
The following changes are published on the origin/R5_0_0_maintenance and origin/master branches:

[519695] Check window != null when processing bounds changes.

- Automatic layout is performed in response to bounds changes, however,
during shutdown, the Scene#windowProperty is evaluated, which might be
null, leading to a NPE.
- This fix checks that window is not null when a bounds change occurs.