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

Bug 232723

Summary: Use Clipboard will cause exception in the GEF Editor.
Product: [Tools] GEF Reporter: Chen Chao <cchen>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: nyssen, zqian
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 231728    

Description Chen Chao CLA 2008-05-19 02:59:36 EDT
Use Clipboard will cause exception in the GEF Editor.

Step:
1. Use GEF SDK create a GEF logic example plugin.
2. Modify LogicPasteTemplateAction, add isEnabled method:
	public boolean isEnabled() {
		return new Clipboard(Display.getDefault()).getContents(TextTransfer
				.getInstance()) != null;
	}
3. Run the eclipse application.
4. Open a logic editor.
5. Open a jface dialog, such as Eclipse Preference Dialog.

Expect: N/A
Actual: Throw exception.

java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
	at java.util.HashMap$KeyIterator.next(HashMap.java:877)
	at org.eclipse.ui.internal.handlers.HandlerAuthority.processChangedCommands(HandlerAuthority.java:627)
	at org.eclipse.ui.internal.handlers.HandlerAuthority.access$1(HandlerAuthority.java:610)
	at org.eclipse.ui.internal.handlers.HandlerAuthority$1.propertyChange(HandlerAuthority.java:175)
	at org.eclipse.ui.internal.services.EvaluationAuthority$1.run(EvaluationAuthority.java:252)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.services.EvaluationAuthority.fireServiceChange(EvaluationAuthority.java:246)
	at org.eclipse.ui.internal.services.EvaluationAuthority.endSourceChange(EvaluationAuthority.java:197)
	at org.eclipse.ui.internal.services.EvaluationAuthority.sourceChanged(EvaluationAuthority.java:135)
	at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:306)
	at org.eclipse.ui.internal.services.ExpressionAuthority.sourceChanged(ExpressionAuthority.java:285)
	at org.eclipse.ui.AbstractSourceProvider.fireSourceChanged(AbstractSourceProvider.java:99)
	at org.eclipse.ui.internal.services.ActivePartSourceProvider.checkActivePart(ActivePartSourceProvider.java:259)
	at org.eclipse.ui.internal.services.ActivePartSourceProvider$2.windowDeactivated(ActivePartSourceProvider.java:129)
	at org.eclipse.ui.internal.Workbench$13.run(Workbench.java:825)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
	at org.eclipse.ui.internal.Workbench.fireWindowDeactivated(Workbench.java:823)
	at org.eclipse.ui.internal.WorkbenchWindow$26.shellDeactivated(WorkbenchWindow.java:2948)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:104)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1154)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1178)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1159)
	at org.eclipse.swt.widgets.Shell.filterProc(Shell.java:663)
	at org.eclipse.swt.widgets.Display.filterProc(Display.java:1467)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1541)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3028)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:65)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:582)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:499)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:410)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1154)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3398)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3030)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2394)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2358)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2210)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:494)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:489)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


OS: Linux Redhat AS5. (Windows XP is well)
Eclipse: 3.4M7
GEF: 3.3,3.4 all throw errors.

I used TextEditor to test the bug, but it worked normally.
Comment 1 Alexander Nyßen CLA 2011-03-09 18:04:05 EST
I tried to reproduce this with the current cvs HEAD version (3.7M6) and was not able to do so. Resolving as WORKSFORME though. Please re-open and provide additional detail in case you can reproduce the issue with the current GEF version.