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

Bug 430851

Summary: NPE in SpaceTreeLayoutAlgorithm.setDirection
Product: [Tools] GEF Reporter: Robert Walter <robertw>
Component: GEF LayoutAssignee: Zoltan Ujhelyi <zoltan.ujhelyi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: zoltan.ujhelyi
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
Whiteboard:

Description Robert Walter CLA 2014-03-21 00:09:13 EDT
The overloaded constructor SpaceTreeLayoutAlgorithm(int direction, bool animate) invokes setDirection. In the first line of this method, you check if the direction member of "this" equals the argument => bam!
Comment 1 Robert Walter CLA 2014-03-21 12:08:45 EDT
okay, my bad, the NPE appears a bit later in "setDirection" because the context hasn't been set.

To reproduce this error, just call the constructor like this:
new SpaceTreeLayoutAlgorithm(SpaceTreeLayoutAlgorithm.LEFT_DOWN, true);
Comment 2 Zoltan Ujhelyi CLA 2014-03-27 18:03:36 EDT
Thanks for the examination. I have pushed fixes into master with additional checks that do not try to update the nodes before they are created.