Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-02-27 19:07:11 +0000
committerfbecker2011-02-27 19:07:11 +0000
commit883e01d7ca7648471040589ae5bbe4041befdc70 (patch)
tree76ee995acf4a95b6e6f889258416662d0791cba0 /org.eclipse.mylyn.bugzilla.core
parentaba93ebc17e5c25bd68200601e6f010f58551930 (diff)
downloadorg.eclipse.mylyn.tasks-883e01d7ca7648471040589ae5bbe4041befdc70.tar.gz
org.eclipse.mylyn.tasks-883e01d7ca7648471040589ae5bbe4041befdc70.tar.xz
org.eclipse.mylyn.tasks-883e01d7ca7648471040589ae5bbe4041befdc70.zip
ASSIGNED - bug 333075: Updating of repo configuration failed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333075
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java35
1 files changed, 26 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
index 176e063b8..9e46b9692 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java
@@ -249,20 +249,23 @@ public class BugzillaAttributeMapper extends TaskAttributeMapper {
IRepositoryPerson person = super.getRepositoryPerson(taskAttribute);
if (person.getName() == null) {
if (taskAttribute.getId().equals(BugzillaAttribute.ASSIGNED_TO.getKey())) {
- TaskAttribute attrAssigned = taskAttribute.getTaskData().getRoot().getAttribute(
- BugzillaAttribute.ASSIGNED_TO_NAME.getKey());
+ TaskAttribute attrAssigned = taskAttribute.getTaskData()
+ .getRoot()
+ .getAttribute(BugzillaAttribute.ASSIGNED_TO_NAME.getKey());
if (attrAssigned != null) {
person.setName(attrAssigned.getValue());
}
} else if (taskAttribute.getId().equals(BugzillaAttribute.REPORTER.getKey())) {
- TaskAttribute attrReporter = taskAttribute.getTaskData().getRoot().getAttribute(
- BugzillaAttribute.REPORTER_NAME.getKey());
+ TaskAttribute attrReporter = taskAttribute.getTaskData()
+ .getRoot()
+ .getAttribute(BugzillaAttribute.REPORTER_NAME.getKey());
if (attrReporter != null) {
person.setName(attrReporter.getValue());
}
} else if (taskAttribute.getId().equals(BugzillaAttribute.QA_CONTACT.getKey())) {
- TaskAttribute attrReporter = taskAttribute.getTaskData().getRoot().getAttribute(
- BugzillaAttribute.QA_CONTACT_NAME.getKey());
+ TaskAttribute attrReporter = taskAttribute.getTaskData()
+ .getRoot()
+ .getAttribute(BugzillaAttribute.QA_CONTACT_NAME.getKey());
if (attrReporter != null) {
person.setName(attrReporter.getValue());
}
@@ -275,11 +278,12 @@ public class BugzillaAttributeMapper extends TaskAttributeMapper {
public Map<String, String> getOptions(TaskAttribute attribute) {
RepositoryConfiguration configuration = connector.getRepositoryConfiguration(getTaskRepository().getRepositoryUrl());
if (configuration != null) {
- TaskAttribute attributeProduct = attribute.getTaskData().getRoot().getMappedAttribute(
- BugzillaAttribute.PRODUCT.getKey());
+ TaskAttribute attributeProduct = attribute.getTaskData()
+ .getRoot()
+ .getMappedAttribute(BugzillaAttribute.PRODUCT.getKey());
if (attributeProduct != null && attributeProduct.getValue().length() > 0) {
List<String> options = configuration.getAttributeOptions(attributeProduct.getValue(), attribute);
- if (options.size() == 0 && attribute.getId().equals("resolutionInput")) {
+ if (options.size() == 0 && attribute.getId().equals("resolutionInput")) { //$NON-NLS-1$
options = configuration.getOptionValues(BugzillaAttribute.RESOLUTION, attributeProduct.getValue());
// DUPLICATE and MOVED have special meanings so do not show as resolution
// TODO: COPIED FUNCTIONALITY from RepositoryConfiguration.addOperation() refactor.
@@ -290,6 +294,19 @@ public class BugzillaAttributeMapper extends TaskAttributeMapper {
for (String option : options) {
newOptions.put(option, option);
}
+ if (newOptions != null && !newOptions.isEmpty()) {
+ List<String> values = attribute.getValues();
+ for (String value : values) {
+ if (!newOptions.containsKey(value)) {
+ // the RepositoryConfiguration is not up to date a new option was add
+ // but Mylyn has not updated the RepositoryConfiguration. So we can have a value
+ // which is not in the Options of the RepositoryConfiguration and need to add
+ // it to the newOptions.
+ // TODO: change this with bug 338347
+ newOptions.put(value, value);
+ }
+ }
+ }
return newOptions;
}
}

Back to the top