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

Bug 511974

Summary: IBendableContentPart#getVisualBendPoints() throws NPE when closing the "MVC Logo Example" view while curve and anchorage are selected.
Product: [Tools] GEF Reporter: Matthias Wienand <matthias.wienand>
Component: GEF MVCAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 1.1.0   
Target Milestone: 5.0.0 (Oxygen) M6   
Hardware: All   
OS: All   
Whiteboard:

Description Matthias Wienand CLA 2017-02-09 09:03:55 EST
Within the "MVC Logo Example" view, selecting a curve together with one of its anchorages, and then closing Eclipse, results in a NullPointerException that is thrown by IBendableVisualPart#getVisualBendPoints(), because the root-part is accessed although it is null.
Comment 1 Matthias Wienand CLA 2017-02-13 09:09:51 EST
The underlying problem is that parts are not removed from the viewer models upon disposal of the view, therefore, any pending feedback or handles are still refreshed. When the location for such a part is determined (as part of refreshing the visualization), the bend points of the host part are queried, which leads to the NPE.

Accordingly, I added code to clear the viewer models before the contents are cleared when disposing the example view. Moreover, I implemented checks within the viewer models (SelectionModel, HoverMode, and FocusModel), as well as the handle and feedback parts, to ensure that the models are consistent.

The code is published on the master branch, therefore, I resolve this ticket as fixed for 5.0.0 M6.