Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ve-dev] Need help with ConcurrentModificationException


Hi,

Don't do ever getCommand().execute() to a live connected model. That bypasses the transaction control mechanism that VE has. When you do getCommand().execute() it doesn't know there is a transaction going on so it has to respond immediately to every change. You must go through the command stack, then the VE knows there is a transaction of commands and will only do one update at the end.

How is this series of commands being kicked off? Is it the result of a menu action? Is it the result of a property change? How this is kicked off will determine how to use the command stack.

Thanks,
Rich



Gerald Rosenberg <gerald@xxxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

07/05/2006 01:24 AM

Please respond to
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>

To
Discussions people developing code for the Visual Editor project <ve-dev@xxxxxxxxxxx>
cc
Subject
[ve-dev] Need help with ConcurrentModificationException





Running latest version of VE from Calipso (appears to be 1.2RC3).

Constructing a somewhat large set of commands to be applied to VE to reconstruct/update the FormLayout source code:

rcb
= new RuledCommandBuilder(policy.getEditDomain());
rcb
.append(reviseLayoutManagerCommand(colSpec, rowSpec));
rcb
.append(reviseGroupsCommand(sfColumnGroups, colGroups));
rcb
.append(reviseGroupsCommand(sfRowGroups, rowGroups));
rcb
.append(reviseConstraintsCommand(slotSpec));
rcb
.getCommand().execute();

Each of the "revise...Command()" methods can return multiple commands as a Command.  In limited testing, the execute does seem to work/make the intended source code changes.  But, VE does seem to labor a bit (the JPanel display flickers), and I get the below exception.  I am also getting  a lot of VisualComponentAdapter#componentValidated() events back from the remote VE, rather than just one terminal event.

Is there a more appropriate way to batch these commands to VE?  

Thanks,
Gerald




!ENTRY org.eclipse.ui 4 4 2006-07-04 22:02:35.475
!MESSAGE Unhandled event loop exception
!ENTRY org.eclipse.ui 4 0 2006-07-04 22:02:35.475
!MESSAGE Failed to execute runnable (java.util.ConcurrentModificationException)
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.util.ConcurrentModificationException)
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:126)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3325)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at org.eclipse.ve.internal.jfc.core.ComponentManager$4.run(ComponentManager.java:1289)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
... 20 more
_______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top