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

Bug 323243

Summary: [IDE] Unhandled event loop exception when cancelling open project
Product: [Eclipse Project] Platform Reporter: Jens Baumgart <jens.baumgart>
Component: UIAssignee: John Arthorne <john.arthorne>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3 CC: darin.eclipse, john.arthorne
Version: 3.6   
Target Milestone: 3.7 M4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Fix none

Description Jens Baumgart CLA 2010-08-20 08:49:08 EDT
Build Identifier: I20100608-0911

Open a closed project in package explorer.
Dialog with message "should referenced projects aloso be opened where applicable" appears.
Click "Cancel"

Exception is logged:

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.core.runtime.OperationCanceledException)
	at org.eclipse.swt.SWT.error(SWT.java:4083)
	at org.eclipse.swt.SWT.error(SWT.java:3998)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: org.eclipse.core.runtime.OperationCanceledException
	at org.eclipse.ui.actions.OpenResourceAction.promptToOpenWithReferences(OpenResourceAction.java:178)
	at org.eclipse.ui.actions.OpenResourceAction.access$1(OpenResourceAction.java:163)
	at org.eclipse.ui.actions.OpenResourceAction$2.run(OpenResourceAction.java:248)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	... 23 more


Reproducible: Always
Comment 1 Paul Webster CLA 2010-11-03 08:01:03 EDT
Caused by the fix for bug 139211

PW
Comment 2 John Arthorne CLA 2010-11-03 14:57:53 EDT
I'm having a 3.7 week so I'll take this.
Comment 3 John Arthorne CLA 2010-11-03 15:12:15 EDT
Created attachment 182322 [details]
Fix

It is actually disingenuous to offer a cancel button here at all. In order to determine if this question is needed, we need to open the project so we can see if it has references. Since we have already opened the project at the point where we prompt, the notion of "Cancel" doesn't really make sense (we would need to close the project again to honor the cancel request properly). At this point the valid options are 1) Yes, please open references, or 2) Don't open references and we are already done.

I have therefore changed from a yes/no/cancel dialog to a simple yes/no dialog. However I still handle the cancel code path in the patch because the user can close the prompt dialog which equates to "do nothing further".
Comment 4 John Arthorne CLA 2010-11-03 15:12:33 EDT
Fixed in HEAD.
Comment 5 John Arthorne CLA 2010-12-07 17:37:14 EST
Verified in I20101202-2256.