diff options
author | spingel | 2008-05-29 21:37:21 +0000 |
---|---|---|
committer | spingel | 2008-05-29 21:37:21 +0000 |
commit | ea197574697539fc2bb9b3a07e2ce02534693e3a (patch) | |
tree | 58e649de7291bdf6981054149f04cd10169ca35d /org.eclipse.mylyn.tasks.core/src/org | |
parent | 48c8757661ebcf33dfc72a2e15d7531d89011354 (diff) | |
download | org.eclipse.mylyn.tasks-ea197574697539fc2bb9b3a07e2ce02534693e3a.tar.gz org.eclipse.mylyn.tasks-ea197574697539fc2bb9b3a07e2ce02534693e3a.tar.xz org.eclipse.mylyn.tasks-ea197574697539fc2bb9b3a07e2ce02534693e3a.zip |
Incomplete - bug 234685: ClassCastException on startup
https://bugs.eclipse.org/bugs/show_bug.cgi?id=234685
Diffstat (limited to 'org.eclipse.mylyn.tasks.core/src/org')
3 files changed, 23 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java index 987b14e16..de24f42b9 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/data/TaskDataStateReader.java @@ -56,7 +56,16 @@ public class TaskDataStateReader extends DefaultHandler { child.setValue(getValue(attributes, ITaskDataConstants.ATTRIBUTE_IS_PATCH)); child.getMetaData().putValue(TaskAttribute.META_ATTRIBUTE_TYPE, TaskAttribute.TYPE_BOOLEAN); - addElementHandler(new AttributeHandler10(this, attribute)); + addElementHandler(new AttributeHandler10(this, attribute) { + @Override + protected String mapId(String value) { + // migrate key for description + if (TaskAttribute.DESCRIPTION.equals(value)) { + return TaskAttribute.ATTACHMENT_DESCRIPTION; + } + return super.mapId(value); + } + }); } } @@ -77,8 +86,8 @@ public class TaskDataStateReader extends DefaultHandler { // detect type if (attribute.getOptions().size() > 0) { if (attribute.getValues().size() > 1) { - attribute.getMetaData().putValue(TaskAttribute.META_ATTRIBUTE_TYPE, - TaskAttribute.TYPE_MULTI_SELECT); + attribute.getMetaData() + .putValue(TaskAttribute.META_ATTRIBUTE_TYPE, TaskAttribute.TYPE_MULTI_SELECT); } else { attribute.getMetaData().putValue(TaskAttribute.META_ATTRIBUTE_TYPE, TaskAttribute.TYPE_SINGLE_SELECT); @@ -88,7 +97,7 @@ public class TaskDataStateReader extends DefaultHandler { @Override public void start(String uri, String localName, String name, Attributes attributes) throws SAXException { - String id = getValue(attributes, ITaskDataConstants.ATTRIBUTE_ID); + String id = mapId(getValue(attributes, ITaskDataConstants.ATTRIBUTE_ID)); String label = getValue(attributes, ITaskDataConstants.ATTRIBUTE_NAME); boolean hidden = Boolean.parseBoolean(getValue(attributes, ITaskDataConstants.ATTRIBUTE_HIDDEN)); boolean readOnly = Boolean.parseBoolean(getValue(attributes, ITaskDataConstants.ATTRIBUTE_READONLY)); @@ -101,6 +110,10 @@ public class TaskDataStateReader extends DefaultHandler { addElementHandler(new MetaDataHandler10(this, attribute)); } + protected String mapId(String value) { + return value; + } + } private class AttributeHandler20 extends ElementHandler { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java index 43fa9f653..b11474d4d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SubmitTaskJob.java @@ -14,6 +14,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; +import org.eclipse.mylyn.commons.core.StatusHandler; import org.eclipse.mylyn.commons.net.Policy; import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants; import org.eclipse.mylyn.internal.tasks.core.TaskTask; @@ -90,7 +91,10 @@ public class SubmitTaskJob extends SubmitJob { } catch (OperationCanceledException e) { return Status.CANCEL_STATUS; } catch (Exception e) { - errorStatus = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, e.getMessage(), e); + StatusHandler.log(new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, + "Unexpected error during task submission", e)); + errorStatus = new Status(IStatus.ERROR, ITasksCoreConstants.ID_PLUGIN, "Unexpected error: " + + e.getMessage(), e); } finally { monitor.done(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java index 717e976e1..72f78ede8 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/TaskAttribute.java @@ -36,8 +36,7 @@ public final class TaskAttribute { public static final String ATTACHMENT_DATE = "task.common.attachment.date"; - // NOTE: uses the same value as DESCRIPTION to support migration of legacy task data - public static final String ATTACHMENT_DESCRIPTION = "task.common.description"; + public static final String ATTACHMENT_DESCRIPTION = "task.common.attachment.description"; public static final String ATTACHMENT_FILENAME = "filename"; |