Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 88629 - [Commands] ConcurrentModificationException in command manager
Summary: [Commands] ConcurrentModificationException in command manager
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 88632
  Show dependency tree
 
Reported: 2005-03-21 07:27 EST by Dani Megert CLA
Modified: 2005-05-11 15:43 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2005-03-21 07:27:46 EST
I20050315-1100

I added new code that was removing an excecution listener while being notified
about an command execution.


!ENTRY org.eclipse.ui 4 4 2005-03-21 13:24:54.125
!MESSAGE Unhandled event loop exception
Unhandled event loop exception
Reason:

!ENTRY org.eclipse.ui 4 0 2005-03-21 13:24:54.125
!MESSAGE java.util.ConcurrentModificationException
!STACK 0
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:448)
	at java.util.AbstractList$Itr.next(AbstractList.java:419)
	at
org.eclipse.core.commands.CommandManager$ExecutionListener.postExecuteSuccess(CommandManager.java:78)
	at org.eclipse.core.commands.Command.firePostExecuteSuccess(Command.java:425)
	at org.eclipse.core.commands.Command.execute(Command.java:337)
	at
org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:395)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:418)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:695)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:738)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:509)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$2(WorkbenchKeyboard.java:452)
	at
org.eclipse.ui.internal.keys.WorkbenchKeyboard$1.handleEvent(WorkbenchKeyboard.java:219)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:777)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:841)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:879)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:875)
	at org.eclipse.swt.widgets.Widget.wmSysKeyDown(Widget.java:2045)
	at org.eclipse.swt.widgets.Control.WM_SYSKEYDOWN(Control.java:3762)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:3097)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:3466)
	at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1548)
	at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:648)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1624)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2525)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1520)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1484)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:305)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:338)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:151)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:268)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
	at org.eclipse.core.launcher.Main.run(Main.java:887)
	at org.eclipse.core.launcher.Main.main(Main.java:871)
java.util.ConcurrentModificationException
Comment 1 Dani Megert CLA 2005-03-21 07:29:01 EST
Not sure whether this belongs to Runtime or Resources.
Comment 2 Dani Megert CLA 2005-03-21 08:43:58 EST
Please note that the bug is in Command and CommandManager.
Comment 3 Douglas Pollock CLA 2005-03-21 10:28:03 EST
Why do you need to remove the listener during the postExecuteSuccess?  How are
you using this API?
Comment 4 Dani Megert CLA 2005-03-21 10:56:41 EST
See bug 88632. The idea is to listen for commands being executed, so that we can
end the compound text change. Since we only want to listen for command execution
once a compound change has started, we have to remove the listener upon
notification.

I see no reason why the code shouldn't allow this.
Comment 5 Douglas Pollock CLA 2005-03-21 10:58:48 EST
I can fix this up, but I don't have enough time for 3.1 M6.
Comment 6 John Arthorne CLA 2005-04-27 15:17:19 EDT
This must have ended in the resources bucket by accident.  Changing component to UI.
Comment 7 Douglas Pollock CLA 2005-05-06 14:49:58 EDT
I fixed all the possible cases where this can happen in the Command and
CommandManager.  I've also posted a general design question to platform-ui-dev,
as this particular (broken) pattern seems to appear elsewhere as well.
Comment 8 Douglas Pollock CLA 2005-05-11 15:43:06 EDT
Verified in I20050509-2010.