Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-21 16:13:07 -0400
committerspingel2008-08-21 16:13:07 -0400
commitcf55b3bf21b9a38bd3e650eab5f3cd146b740885 (patch)
treecf03c5308e5308ba0e782124c3b00ae389449422
parentfd801766737c353bc51b821f5069b8b8269022d9 (diff)
downloadorg.eclipse.mylyn.tasks-cf55b3bf21b9a38bd3e650eab5f3cd146b740885.tar.gz
org.eclipse.mylyn.tasks-cf55b3bf21b9a38bd3e650eab5f3cd146b740885.tar.xz
org.eclipse.mylyn.tasks-cf55b3bf21b9a38bd3e650eab5f3cd146b740885.zip
ASSIGNED - bug 238371: errors when restoring working sets
https://bugs.eclipse.org/bugs/show_bug.cgi?id=238371
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
index 44633a9a7..2200a2824 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementFactory.java
@@ -30,8 +30,7 @@ public class TaskWorkingSetElementFactory implements IElementFactory {
static final String HANDLE_TASK = "handle.task";
- // XXX this looks like a c&p error but changing it would break restoring of working sets
- static final String HANDLE_PROJECT = "handle.task";
+ static final String HANDLE_PROJECT = "handle.project";
public IAdaptable createElement(IMemento memento) {
String taskHandle = memento.getString(HANDLE_TASK);
@@ -56,6 +55,18 @@ public class TaskWorkingSetElementFactory implements IElementFactory {
"Could not not determine project for handle: " + projectHandle, t));
}
}
+ // prior to mylyn 3.0.2 task handles and project handles were identical
+ if (taskHandle != null) {
+ try {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(taskHandle);
+ if (project != null) {
+ return project;
+ }
+ } catch (Throwable t) {
+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
+ "Could not not determine project for handle: " + taskHandle, t));
+ }
+ }
return null;
}
} \ No newline at end of file

Back to the top