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

Bug 441386

Summary: Zest.FX viewers run into java.lang.IllegalArgumentException: Given Runnable is not contained in the list.
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF ZestAssignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: matthias.wienand
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alexander Nyßen CLA 2014-08-07 16:33:12 EDT
I quite easily ran into this exception with the Zest.FX example viewer as well as the DOT Graph Viewer.

java.lang.IllegalArgumentException: Given Runnable is not contained in the list.
	at org.eclipse.gef4.zest.fx.layout.GraphLayoutContext.removeOnFlushChanges(GraphLayoutContext.java:90)
	at org.eclipse.gef4.zest.fx.behaviors.AbstractLayoutBehavior.onLayoutContextChange(AbstractLayoutBehavior.java:86)
	at org.eclipse.gef4.zest.fx.behaviors.AbstractLayoutBehavior$1.propertyChange(AbstractLayoutBehavior.java:34)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at org.eclipse.gef4.zest.fx.models.DefaultLayoutModel.setLayoutContext(DefaultLayoutModel.java:45)
	at org.eclipse.gef4.zest.fx.parts.GraphRootPart$1.propertyChange(GraphRootPart.java:52)
	at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
	at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
	at org.eclipse.gef4.mvc.models.DefaultContentModel.setContents(DefaultContentModel.java:46)
	at org.eclipse.gef4.mvc.viewer.AbstractViewer.setContents(AbstractViewer.java:309)
	at org.eclipse.gef4.zest.fx.ui.view.ZestFxUiView.setGraph(ZestFxUiView.java:65)
	at org.eclipse.gef4.zest.fx.ui.view.DotGraphView$1.run(DotGraphView.java:125)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3983)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 1 Matthias Wienand CLA 2014-08-08 08:21:18 EDT
I added a check in the AbstractLayoutBehavior#onLayoutContextChange() method to ensure the Runnable is only removed from the previous GraphLayoutContext if it was previously added. The code is published on the master branch in the git repository. Therefore I change the status of this ticket to RESOLVED, FIXED.