diff options
author | spingel | 2010-02-06 03:58:55 +0000 |
---|---|---|
committer | spingel | 2010-02-06 03:58:55 +0000 |
commit | cf3de5926e0ef087754125d6ccd0a4baee2ba61c (patch) | |
tree | 2e2cf797c2307a90c1f41422b65fe40402131dc0 | |
parent | 90f7bf2d8b4b301f4807d724d129c07c1f4fed33 (diff) | |
download | org.eclipse.mylyn.tasks-cf3de5926e0ef087754125d6ccd0a4baee2ba61c.tar.gz org.eclipse.mylyn.tasks-cf3de5926e0ef087754125d6ccd0a4baee2ba61c.tar.xz org.eclipse.mylyn.tasks-cf3de5926e0ef087754125d6ccd0a4baee2ba61c.zip |
RESOLVED - bug 235479: OperationCanceledException when opening task
https://bugs.eclipse.org/bugs/show_bug.cgi?id=235479
2 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java index 3aa4c9e95..0ed62a3af 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskList.java @@ -650,9 +650,14 @@ public class TaskList implements ITaskList, ITransferList { } public void run(ITaskListRunnable runnable, IProgressMonitor monitor) throws CoreException { + run(runnable, monitor, false); + } + + public void run(ITaskListRunnable runnable, IProgressMonitor monitor, boolean ignoreInterrupts) + throws CoreException { monitor = Policy.monitorFor(monitor); try { - lock(monitor); + lock(monitor, ignoreInterrupts); runnable.execute(monitor); @@ -668,7 +673,7 @@ public class TaskList implements ITaskList, ITransferList { } } - private void lock(IProgressMonitor monitor) throws CoreException { + private void lock(IProgressMonitor monitor, boolean ignoreInterrupts) throws CoreException { while (!monitor.isCanceled()) { try { if (lock.acquire(3000)) { @@ -678,7 +683,11 @@ public class TaskList implements ITaskList, ITransferList { return; } } catch (InterruptedException e) { - throw new OperationCanceledException(); + if (ignoreInterrupts) { + Thread.currentThread().interrupt(); + } else { + throw new OperationCanceledException(); + } } } throw new OperationCanceledException(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java index c00993df4..9d05fff82 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataManager.java @@ -139,7 +139,7 @@ public class TaskDataManager implements ITaskDataManager { } result[0] = state; } - }); + }, null, true); if (changed[0]) { taskList.notifyElementChanged(task); } |