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

Bug 482740

Summary: SpringLayoutExample has endless exception loop when remove/add node
Product: [Tools] GEF Reporter: Frank Benoit <frank.rene.benoit>
Component: GEF ZestAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: unspecified   
Target Milestone: 4.0.0 / 3.11.0 (Neon) M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Frank Benoit CLA 2015-11-21 06:39:07 EST
This example: org.eclipse.gef4.layout.examples.SpringLayoutExample
From GIT SHA-1: 4fb8c07eca32b8a1b592c6534ff186168e602513

Sequence of actions:
1. "1-2" click "-"
2. "Root" click "+"
3. "1-2" click "-"

Now it enters a endless sequence of exceptions:

Exception in thread "JavaFX Application Thread" java.util.NoSuchElementException
	at java.util.HashMap$HashIterator.nextNode(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at com.google.common.collect.AbstractMapBasedMultimap$KeySet$1.next(AbstractMapBasedMultimap.java:936)
	at java.util.Collections$UnmodifiableCollection$1.next(Unknown Source)
	at org.eclipse.gef4.mvc.fx.policies.FXResizeTranslateOnHandleDragPolicy.getTargetPart(FXResizeTranslateOnHandleDragPolicy.java:121)
	at org.eclipse.gef4.mvc.fx.policies.FXResizeTranslateOnHandleDragPolicy.release(FXResizeTranslateOnHandleDragPolicy.java:167)
	at org.eclipse.gef4.mvc.fx.tools.FXClickDragTool$1.release(FXClickDragTool.java:225)
Comment 1 Frank Benoit CLA 2015-11-22 06:06:50 EST
This problem exists in all of the examples in layout and zest.
Comment 2 Alexander Nyßen CLA 2015-11-22 09:27:40 EST
The "hiding"-related parts of Zest.FX need to be revised/refactored. This exception is an indication that the indirection through hiding-behaviors is not adequate.
Comment 3 Alexander Nyßen CLA 2015-11-24 13:39:33 EST
Actually, the problem is not related to hiding at all. You can also reproduce it by dragging a normal resize handle. Having investigated it in detail, the underlying reason for this is that ZestFxModule adds bindings for resize-on-drag and rotate-on-drag for AbstractFXHandlePart, so that this binding is also applied to the hide and show hover handle parts (where it should not be bound). There, it leads to problems of course. 

I fixed the issue by adjusting the bindings, so that resize-on-drag and rotate-on-drag are only bound for FXRectangleSegmentPart, not for all handle parts.

Pushed all changes to origin/master. Resolving as fixed in 3.11.0 M4.