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

Bug 515550

Summary: Infinite loop in SpaceTreeLayout
Product: [Tools] GEF Reporter: Zoltan Ujhelyi <zoltan.ujhelyi>
Component: GEF LayoutAssignee: Zoltan Ujhelyi <zoltan.ujhelyi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: 5.0.0 (Oxygen) M7   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Zoltan Ujhelyi CLA 2017-04-21 03:27:50 EDT
At the end of the fitNodesWithinBounds of SpaceTreeLayout, the algorithms tries to find the best candidate to fit the nodes in the boundaries of the drawing area.

However, if the space is too small to fit all nodes without overlapping, it is possible that no solution is possible, in which case the loop does not finish.

A simple break condition using the total number of iterations should be sufficient to make this loop terminate; in such case the algorithm will result in a graph that requires scrolling; otherwise in my testing the resulting layouts are appropriate.
Comment 1 Zoltan Ujhelyi CLA 2017-04-21 03:57:58 EDT
A fix was provided in https://github.com/eclipse/gef/commit/bfffb4eaa683b85e52158c344ee6e1b17607efdb.