Bug 64908 - [Tasks] Task tag creation and locked workspace
Summary: [Tasks] Task tag creation and locked workspace
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: 3.0   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 66484 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-01 06:36 EDT by Dirk Baeumer CLA
Modified: 2004-06-10 18:27 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-06-01 06:36:36 EDT
RC1

- lock workspace
- select some text in editor
- execute edit->Task Tag

observe: the workbench dialog pops up to create task tags

- press OK

observe: nothing happens

- press Cancel

You get the following exception in the log:

!ENTRY org.eclipse.ui 4 0 Jun 01, 2004 12:32:42.886
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
        at org.eclipse.swt.SWT.error(SWT.java:2691)
        at org.eclipse.swt.SWT.error(SWT.java(Inlined Compiled Code))
        at org.eclipse.swt.SWT.error(SWT.java(Inlined Compiled Code))
        at org.eclipse.swt.widgets.Widget.error(Widget.java(Inlined Compiled 
Code))
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java(Compiled 
Code))
        at org.eclipse.swt.widgets.Control.getMonitor(Control.java:851)
        at org.eclipse.jface.window.Window.getInitialLocation(Window.java:473)
        at org.eclipse.jface.window.Window.initializeBounds(Window.java:615)
        at org.eclipse.jface.dialogs.Dialog.initializeBounds(Dialog.java:590)
        at org.eclipse.jface.window.Window.create(Window.java:351)
        at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:925)
        at org.eclipse.jface.window.Window.open(Window.java:637)
        at org.eclipse.ui.internal.progress.BlockedJobsDialog$1.runInUIThread
(BlockedJobsDialog.java:206)
        at org.eclipse.ui.progress.UIJob$1.run(UIJob.java(Compiled Code))
        at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java(Compiled Code))
        at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java
(Inlined Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at 
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop
(EventLoopProgressMonitor.java(Compiled Code))
        at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled
(EventLoopProgressMonitor.java:90)
        at org.eclipse.core.internal.jobs.ThreadJob.isCanceled
(ThreadJob.java:116)
        at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:146)
        at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:87)
        at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:170)
        at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:95)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1668)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1693)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.saveChanges
(TaskPropertiesDialog.java:514)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.okPressed
(TaskPropertiesDialog.java:476)
        at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:506)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at 
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop
(EventLoopProgressMonitor.java(Compiled Code))
        at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled
(EventLoopProgressMonitor.java:90)
        at org.eclipse.core.internal.jobs.ThreadJob.isCanceled
(ThreadJob.java:116)
        at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:146)
        at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:87)
        at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:170)
        at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:95)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1668)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1693)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.saveChanges
(TaskPropertiesDialog.java:514)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.okPressed
(TaskPropertiesDialog.java:476)
        at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:506)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at 
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop
(EventLoopProgressMonitor.java(Compiled Code))
        at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled
(EventLoopProgressMonitor.java:90)
        at org.eclipse.core.internal.jobs.ThreadJob.isCanceled
(ThreadJob.java:116)
        at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:146)
        at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:87)
        at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:170)
        at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:95)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1668)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1693)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.saveChanges
(TaskPropertiesDialog.java:514)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.okPressed
(TaskPropertiesDialog.java:476)
        at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:506)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at 
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop
(EventLoopProgressMonitor.java(Compiled Code))
        at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled
(EventLoopProgressMonitor.java:90)
        at org.eclipse.core.internal.jobs.ThreadJob.isCanceled
(ThreadJob.java:116)
        at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:146)
        at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:87)
        at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:170)
        at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:95)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1668)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1693)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.saveChanges
(TaskPropertiesDialog.java:514)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.okPressed
(TaskPropertiesDialog.java:476)
        at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:506)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at 
org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.runEventLoop
(EventLoopProgressMonitor.java(Compiled Code))
        at org.eclipse.ui.internal.dialogs.EventLoopProgressMonitor.isCanceled
(EventLoopProgressMonitor.java:90)
        at org.eclipse.core.internal.jobs.ThreadJob.isCanceled
(ThreadJob.java:116)
        at org.eclipse.core.internal.jobs.ThreadJob.joinRun(ThreadJob.java:146)
        at org.eclipse.core.internal.jobs.ImplicitJobs.begin
(ImplicitJobs.java:87)
        at org.eclipse.core.internal.jobs.JobManager.beginRule
(JobManager.java:170)
        at org.eclipse.core.internal.resources.WorkManager.checkIn
(WorkManager.java:95)
        at org.eclipse.core.internal.resources.Workspace.prepareOperation
(Workspace.java:1628)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1668)
        at org.eclipse.core.internal.resources.Workspace.run
(Workspace.java:1693)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.saveChanges
(TaskPropertiesDialog.java:514)
        at org.eclipse.ui.views.tasklist.TaskPropertiesDialog.okPressed
(TaskPropertiesDialog.java:476)
        at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:365)
        at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:506)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java
(Compiled Code))
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled 
Code))
        at org.eclipse.jface.window.Window.open(Window.java:648)
        at org.eclipse.ui.texteditor.AddTaskAction.run(AddTaskAction.java:58)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:881)
        at org.eclipse.ui.actions.RetargetAction.runWithEvent
(RetargetAction.java:212)
        at 
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:915)
        at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:866)
        at org.eclipse.jface.action.ActionContributionItem$7.handleEvent
(ActionContributionItem.java:785)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java(Inlined 
Compiled Code))
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java
(Compiled Code))
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1334)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:253)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141)
        at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:96)
        at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:334)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:273)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:128)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:79)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:41)
        at java.lang.reflect.Method.invoke(Method.java:386)
        at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
        at org.eclipse.core.launcher.Main.run(Main.java:638)
        at org.eclipse.core.launcher.Main.main(Main.java:622)
Comment 1 Dirk Baeumer CLA 2004-06-01 06:58:10 EDT
After running into this scenario the blocked dialog seems to be corrupted. 
Every subsequent action which enters a blocked scenario doesn't show the 
blocked dialog anymore, but allows arbitrary stacking of operations. Raising 
severity since this brings the workspace into a dangerous state.
Comment 2 Tod Creasey CLA 2004-06-01 16:37:22 EDT
I have logged the problem with the BlockedJobsDialog in Bug 65160.

The TaskPropertiesDialog is relying on the operation being faster than the 
user can click. This was always an issue but it is easier to make happen now 
(see Dirks steps).

The best bet is either
1) disable the buttons on the dialog when running. The only downside of this 
is that you won't get blockages reported
2) Run it as a Job  which locks the resource only and collect up the 
information you need before you run it. schedule the job then close the dialog
3) collect up the information you need before the WorkspaceModifyOperation and 
then process the button pressed first.

I think 2 is the best option
Comment 3 Tod Creasey CLA 2004-06-01 16:38:25 EDT
P.S. the easiest way to lock the workspace to test this is to do it self 
hosted with org.eclipse.ui.examples.jobs loaded. Open the JobFactory and 
select Lock workspace before running the job
Comment 4 Erich Gamma CLA 2004-06-03 05:33:01 EDT
One cause of this problem is that the TaskPropertiesDialog is executing the 
operation with a null progress monitor (see below). Using null progress 
monitors should be avoided and instead the IProgressService.busyCursorWhile() 
should be used. Once bug# 64937 is addressed then 
IProgressService.busyCursorWhile() can also be used from dialogs (in fact this 
would be a good test case). 

TaskPropertiesDialog.saveChanges():			
   ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
	public void run(IProgressMonitor monitor) throws CoreException {
		createOrUpdateMarker();
	}
   }, null);
Comment 5 Tod Creasey CLA 2004-06-07 16:28:28 EDT
Moved to busyCursorWhile as suggested by Erich. Fixed in build >20040607
Comment 6 Tod Creasey CLA 2004-06-09 11:40:02 EDT
This working when you add task from an editor but not from the TasksView. 
Reopening to investigate the difference.
Comment 7 Tod Creasey CLA 2004-06-09 11:48:13 EDT

*** This bug has been marked as a duplicate of 65813 ***
Comment 8 Tod Creasey CLA 2004-06-09 11:49:04 EDT
Not a dup
Comment 9 Tod Creasey CLA 2004-06-09 14:37:46 EDT
It turns out that these two operations have totally different dialogs - see 
Bug 66375 for a better description.

I have fixed this so that both use the progress service now.
Comment 10 Christophe Cornu CLA 2004-06-10 17:46:47 EDT
*** Bug 66484 has been marked as a duplicate of this bug. ***
Comment 11 Tod Creasey CLA 2004-06-10 18:27:17 EDT
Verified both from the tasks view and the editor in 20040610-1700