Community
Participate
Working Groups
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
Not sure whether this belongs to Runtime or Resources.
Please note that the bug is in Command and CommandManager.
Why do you need to remove the listener during the postExecuteSuccess? How are you using this API?
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.
I can fix this up, but I don't have enough time for 3.1 M6.
This must have ended in the resources bucket by accident. Changing component to UI.
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.
Verified in I20050509-2010.