Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-05-01 15:25:33 +0000
committerGerrit Code Review @ Eclipse.org2013-05-09 12:59:07 +0000
commit20e8aaf07ff15718cd47180630614e240b687a83 (patch)
tree66eac10b68a4c8ebcc1df83bf3e8e38036b3f822 /org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
parentec1c6c9dfe7c3c63c0a55e0b278c57695772eef7 (diff)
downloadorg.eclipse.mylyn.tasks-20e8aaf07ff15718cd47180630614e240b687a83.tar.gz
org.eclipse.mylyn.tasks-20e8aaf07ff15718cd47180630614e240b687a83.tar.xz
org.eclipse.mylyn.tasks-20e8aaf07ff15718cd47180630614e240b687a83.zip
398239: Bugzilla should return RepositoryStatus (ERROR_INTERNAL) on
invalid taskID in getMultiTaskData Change-Id: Ia31e03314e1a43d3f22596f3dd7d8ff96d8c6ed2 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=398239
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
index 6403a8524..2fa4a3ed9 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
@@ -88,6 +88,8 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
private final SimpleDateFormat simpleFormatter_deltaTS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$
+ private String bugIDValue;
+
public SaxMultiBugReportContentHandler(TaskAttributeMapper mapper, TaskDataCollector collector,
Map<String, TaskData> taskDataMap, List<BugzillaCustomField> customFields,
BugzillaRepositoryConnector connector) {
@@ -150,6 +152,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
taskComment = null;
longDescs = new ArrayList<TaskComment>();
token = null;
+ bugIDValue = null;
break;
case LONG_DESC:
String is_private = attributes.getValue("isprivate"); //$NON-NLS-1$
@@ -309,6 +312,7 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
}
switch (tag) {
case BUG_ID: {
+ bugIDValue = parsedText.trim();
repositoryTaskData = taskDataMap.get(parsedText.trim());
if (repositoryTaskData == null) {
errorMessage = parsedText + Messages.SaxMultiBugReportContentHandler_id_not_found;
@@ -545,8 +549,30 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
IBugzillaConstants.BUGZILLA_PARAM_USECLASSIFICATION, false);
break;
case ALIAS:
+ if (repositoryTaskData == null) {
+ repositoryTaskData = taskDataMap.get(parsedText.trim());
+ if (repositoryTaskData == null) {
+ errorMessage = parsedText + Messages.SaxMultiBugReportContentHandler_id_not_found;
+ bugParseErrorOccurred = true;
+ break;
+ } else {
+ errorMessage = null;
+ bugParseErrorOccurred = false;
+ }
+ }
BugzillaUtil.createAttributeWithKindDefaultIfUsed(parsedText, tag, repositoryTaskData,
IBugzillaConstants.BUGZILLA_PARAM_USEBUGALIASES, false);
+ TaskAttribute attr = repositoryTaskData.getRoot().getMappedAttribute(BugzillaAttribute.BUG_ID.getKey());
+ if (attr == null) {
+ attr = BugzillaTaskDataHandler.createAttribute(repositoryTaskData, BugzillaAttribute.BUG_ID);
+ }
+ attr.setValue(bugIDValue);
+
+ if (exporter != null) {
+ createAttrribute(exporter, BugzillaAttribute.EXPORTER_NAME);
+ } else {
+ createAttrribute("", BugzillaAttribute.EXPORTER_NAME); //$NON-NLS-1$
+ }
break;
case SEE_ALSO:
BugzillaUtil.createAttributeWithKindDefaultIfUsed(parsedText, tag, repositoryTaskData,

Back to the top