Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2012-11-18 16:54:39 +0000
committerFrank Becker2012-11-18 16:54:39 +0000
commitb0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd (patch)
tree1648ce5d6deef27ec715313496f95b99e3b15bc1 /org.eclipse.mylyn.bugzilla.core
parent96e7caac5729da734aaddb017f04a0b2ffad0508 (diff)
downloadorg.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.tar.gz
org.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.tar.xz
org.eclipse.mylyn.tasks-b0003768d5806c2dbc6fdd0e5ae43afcb3d3e2cd.zip
372600: redesign of RepositoryConfiguration
create new usage api Change-Id: Ieb5f1514ac88b9d32b529fdbe27b8f215d0873f6 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=372600
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeMapper.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java8
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java50
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java134
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java2
6 files changed, 85 insertions, 113 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 b920d0b65..7e0d240b5 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
@@ -286,7 +286,7 @@ public class BugzillaAttributeMapper extends TaskAttributeMapper {
if (attributeProduct != null && attributeProduct.getValue().length() > 0) {
List<String> options = configuration.getAttributeOptions(attributeProduct.getValue(), attribute);
if (options.size() == 0 && attribute.getId().equals("resolutionInput")) { //$NON-NLS-1$
- options = configuration.getOptionValues(BugzillaAttribute.RESOLUTION, attributeProduct.getValue());
+ options = configuration.getOptionValues(BugzillaAttribute.RESOLUTION);
// DUPLICATE and MOVED have special meanings so do not show as resolution
// TODO: COPIED FUNCTIONALITY from RepositoryConfiguration.addOperation() refactor.
options.remove("DUPLICATE"); //$NON-NLS-1$
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index c88e6eb3d..ac0e8dfed 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -773,11 +773,11 @@ public class BugzillaClient {
repositoryConfiguration.setValidTransitions(monitor,
configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE), null);
}
- if (!repositoryConfiguration.getProducts().isEmpty()) {
+ if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) {
repositoryConfiguration.setRepositoryUrl(repositoryUrl.toString());
}
- if (!repositoryConfiguration.getProducts().isEmpty()) {
+ if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) {
return repositoryConfiguration;
} else {
if (attempt == 0) {
@@ -1379,9 +1379,9 @@ public class BugzillaClient {
String id = a.getId();
if (id.equals(BugzillaAttribute.BUG_STATUS.getKey())
&& bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) >= 0) {
- if (repositoryConfiguration.getStatusValues().contains(
+ if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
- || repositoryConfiguration.getStatusValues().contains(
+ || repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {
TaskAttribute attributeOperation = taskData.getRoot().getMappedAttribute(
TaskAttribute.OPERATION);
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
index 05a270b2c..70d63d570 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java
@@ -675,7 +675,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector {
// Did not know how the configuration can be null here
return getTaskPriority(priority);
}
- List<String> priorities = repositoryConfiguration.getPriorities();
+ List<String> priorities = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY);
return BugzillaRepositoryConnector.getTaskPriority(priority, priorities);
}
};
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
index 9762f0bfa..1721edb59 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
@@ -449,8 +449,8 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
String product = null;
String component = null;
if (initializationData == null || initializationData.getProduct() == null) {
- if (repositoryConfiguration.getProducts().size() > 0) {
- product = repositoryConfiguration.getProducts().get(0);
+ if (repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).size() > 0) {
+ product = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).get(0);
}
} else {
product = initializationData.getProduct();
@@ -465,18 +465,21 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
component = initializationData.getComponent();
}
- if (component == null && repositoryConfiguration.getComponents(product).size() > 0) {
- component = repositoryConfiguration.getComponents(product).get(0);
+ if (component == null
+ && repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT, product).size() > 0) {
+ component = repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT, product)
+ .get(0);
}
if (component == null) {
- if (repositoryConfiguration.getProducts().size() > 0) {
- product = repositoryConfiguration.getProducts().get(0);
+ if (repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).size() > 0) {
+ product = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).get(0);
}
if (product == null) {
return false;
}
- if (repositoryConfiguration.getComponents(product).size() > 0) {
- component = repositoryConfiguration.getComponents(product).get(0);
+ if (repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT, product).size() > 0) {
+ component = repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT, product)
+ .get(0);
} else {
return false;
}
@@ -532,14 +535,14 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
TaskAttribute productAttribute = createAttribute(taskData, BugzillaAttribute.PRODUCT);
productAttribute.setValue(product);
- List<String> optionValues = repositoryConfiguration.getProducts();
+ List<String> optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT);
Collections.sort(optionValues);
for (String optionValue : optionValues) {
productAttribute.putOption(optionValue, optionValue);
}
TaskAttribute attributeStatus = createAttribute(taskData, BugzillaAttribute.BUG_STATUS);
- optionValues = repositoryConfiguration.getStatusValues();
+ optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS);
for (String option : optionValues) {
attributeStatus.putOption(option, option);
}
@@ -551,8 +554,9 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
attributeStatus.setValue(repositoryConfiguration.getStartStatus());
} else {
- if (repositoryConfiguration.getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
- || repositoryConfiguration.getStatusValues().contains(
+ if (repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
+ BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
+ || repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {
attributeStatus.setValue(IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString());
@@ -565,7 +569,8 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
createAttribute(taskData, BugzillaAttribute.SHORT_DESC);
TaskAttribute attributeVersion = createAttribute(taskData, BugzillaAttribute.VERSION);
- optionValues = repositoryConfiguration.getVersions(productAttribute.getValue());
+ optionValues = repositoryConfiguration.getProductOptionValues(BugzillaAttribute.VERSION,
+ productAttribute.getValue());
Collections.sort(optionValues);
for (String option : optionValues) {
attributeVersion.putOption(option, option);
@@ -575,7 +580,8 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
TaskAttribute attributeComponent = createAttribute(taskData, BugzillaAttribute.COMPONENT);
- optionValues = repositoryConfiguration.getComponents(productAttribute.getValue());
+ optionValues = repositoryConfiguration.getProductOptionValues(BugzillaAttribute.COMPONENT,
+ productAttribute.getValue());
Collections.sort(optionValues);
for (String option : optionValues) {
attributeComponent.putOption(option, option);
@@ -588,8 +594,10 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
TaskRepository taskRepository = taskData.getAttributeMapper().getTaskRepository();
- if (BugzillaUtil.getTaskPropertyWithDefaultTrue(taskRepository, IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE)) {
- optionValues = repositoryConfiguration.getTargetMilestones(productAttribute.getValue());
+ if (BugzillaUtil.getTaskPropertyWithDefaultTrue(taskRepository,
+ IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE)) {
+ optionValues = repositoryConfiguration.getProductOptionValues(BugzillaAttribute.TARGET_MILESTONE,
+ productAttribute.getValue());
if (optionValues.size() > 0) {
TaskAttribute attributeTargetMilestone = createAttribute(taskData, BugzillaAttribute.TARGET_MILESTONE);
for (String option : optionValues) {
@@ -608,7 +616,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
}
TaskAttribute attributePlatform = createAttribute(taskData, BugzillaAttribute.REP_PLATFORM);
- optionValues = repositoryConfiguration.getPlatforms();
+ optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.REP_PLATFORM);
for (String option : optionValues) {
attributePlatform.putOption(option, option);
}
@@ -618,7 +626,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
TaskAttribute attributeOPSYS = createAttribute(taskData, BugzillaAttribute.OP_SYS);
- optionValues = repositoryConfiguration.getOSs();
+ optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.OP_SYS);
for (String option : optionValues) {
attributeOPSYS.putOption(option, option);
}
@@ -628,7 +636,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
TaskAttribute attributePriority = createAttribute(taskData, BugzillaAttribute.PRIORITY);
- optionValues = repositoryConfiguration.getPriorities();
+ optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.PRIORITY);
for (String option : optionValues) {
attributePriority.putOption(option, option);
}
@@ -638,7 +646,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
TaskAttribute attributeSeverity = createAttribute(taskData, BugzillaAttribute.BUG_SEVERITY);
- optionValues = repositoryConfiguration.getSeverities();
+ optionValues = repositoryConfiguration.getOptionValues(BugzillaAttribute.BUG_SEVERITY);
for (String option : optionValues) {
attributeSeverity.putOption(option, option);
}
@@ -662,7 +670,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
createAttribute(taskData, BugzillaAttribute.NEWCC);
createAttribute(taskData, BugzillaAttribute.LONG_DESC);
- List<String> keywords = repositoryConfiguration.getKeywords();
+ List<String> keywords = repositoryConfiguration.getOptionValues(BugzillaAttribute.KEYWORDS);
if (keywords.size() > 0) {
createAttribute(taskData, BugzillaAttribute.KEYWORDS);
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index 4c59fe0db..970490baf 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -95,18 +95,10 @@ public class RepositoryConfiguration implements Serializable {
bugStatus.add(status);
}
- public List<String> getStatusValues() {
- return bugStatus;
- }
-
public void addResolution(String res) {
resolutionValues.add(res);
}
- public List<String> getResolutions() {
- return resolutionValues;
- }
-
/**
* Adds a product to the configuration.
*/
@@ -120,7 +112,7 @@ public class RepositoryConfiguration implements Serializable {
/**
* Returns an array of names of current products.
*/
- public List<String> getProducts() {
+ private List<String> getProducts() {
ArrayList<String> productList = new ArrayList<String>(products.keySet());
Collections.sort(productList, String.CASE_INSENSITIVE_ORDER);
return productList;
@@ -130,7 +122,7 @@ public class RepositoryConfiguration implements Serializable {
* Returns an array of names of component that exist for a given product or <code>null</code> if the product does
* not exist.
*/
- public List<String> getComponents(String product) {
+ private List<String> getComponents(String product) {
ProductEntry entry = products.get(product);
if (entry != null) {
return entry.getComponents();
@@ -143,7 +135,7 @@ public class RepositoryConfiguration implements Serializable {
* Returns an array of names of versions that exist for a given product or <code>null</code> if the product does not
* exist.
*/
- public List<String> getVersions(String product) {
+ private List<String> getVersions(String product) {
ProductEntry entry = products.get(product);
if (entry != null) {
return entry.getVersions();
@@ -152,39 +144,11 @@ public class RepositoryConfiguration implements Serializable {
}
}
- /**
- * Returns an array of names of valid severity values.
- */
- public List<String> getSeverities() {
- return severities;
- }
-
- /**
- * Returns an array of names of valid OS values.
- */
- public List<String> getOSs() {
- return operatingSystems;
- }
-
public void addOS(String os) {
operatingSystems.add(os);
}
/**
- * Returns an array of names of valid platform values.
- */
- public List<String> getPlatforms() {
- return platforms;
- }
-
- /**
- * Returns an array of names of valid platform values.
- */
- public List<String> getPriorities() {
- return priorities;
- }
-
- /**
* Adds a component to the given product.
*/
public void addComponent(String product, String component) {
@@ -215,10 +179,6 @@ public class RepositoryConfiguration implements Serializable {
keywords.add(keyword);
}
- public List<String> getKeywords() {
- return keywords;
- }
-
public void addPlatform(String platform) {
platforms.add(platform);
}
@@ -253,7 +213,7 @@ public class RepositoryConfiguration implements Serializable {
}
- public List<String> getTargetMilestones(String product) {
+ private List<String> getTargetMilestones(String product) {
ProductEntry entry = products.get(product);
if (entry != null) {
return entry.getTargetMilestones();
@@ -362,18 +322,6 @@ public class RepositoryConfiguration implements Serializable {
closedStatusValues.add(value);
}
- public List<String> getComponents() {
- return components;
- }
-
- public List<String> getTargetMilestones() {
- return milestones;
- }
-
- public List<String> getVersions() {
- return versions;
- }
-
public String getRepositoryUrl() {
return repositoryUrl;
}
@@ -416,33 +364,43 @@ public class RepositoryConfiguration implements Serializable {
}
}
- /*
- * Intermediate step until configuration is made generic.
- */
- public List<String> getOptionValues(BugzillaAttribute element, String product) {
+ public List<String> getOptionValues(BugzillaAttribute element) {
switch (element) {
case PRODUCT:
return getProducts();
case TARGET_MILESTONE:
- return getTargetMilestones(product);
+ return milestones;
case BUG_STATUS:
- return getStatusValues();
+ return bugStatus;
case VERSION:
- return getVersions(product);
+ return versions;
case COMPONENT:
- return getComponents(product);
+ return components;
case REP_PLATFORM:
- return getPlatforms();
+ return platforms;
case OP_SYS:
- return getOSs();
+ return operatingSystems;
case PRIORITY:
- return getPriorities();
+ return priorities;
case BUG_SEVERITY:
- return getSeverities();
+ return severities;
case KEYWORDS:
- return getKeywords();
+ return keywords;
case RESOLUTION:
- return getResolutions();
+ return resolutionValues;
+ default:
+ return Collections.emptyList();
+ }
+ }
+
+ public List<String> getProductOptionValues(BugzillaAttribute element, String product) {
+ switch (element) {
+ case TARGET_MILESTONE:
+ return getTargetMilestones(product);
+ case VERSION:
+ return getVersions(product);
+ case COMPONENT:
+ return getComponents(product);
default:
return Collections.emptyList();
}
@@ -644,9 +602,12 @@ public class RepositoryConfiguration implements Serializable {
}
throw e;
}
-
- options = getOptionValues(element, product);
-
+ if ((element == BugzillaAttribute.TARGET_MILESTONE || element == BugzillaAttribute.VERSION || element == BugzillaAttribute.COMPONENT)
+ && (product != null && !product.equals(""))) { //$NON-NLS-1$
+ options = getProductOptionValues(element, product);
+ } else {
+ options = getOptionValues(element);
+ }
if (element != BugzillaAttribute.RESOLUTION && element != BugzillaAttribute.OP_SYS
&& element != BugzillaAttribute.BUG_SEVERITY && element != BugzillaAttribute.PRIORITY
&& element != BugzillaAttribute.BUG_STATUS && element != BugzillaAttribute.TARGET_MILESTONE
@@ -666,8 +627,10 @@ public class RepositoryConfiguration implements Serializable {
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
addValidOperationsBefore4(bugReport);
} else {
- if (getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
- || getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {
+ if (getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
+ BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString())
+ || getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
+ BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString())) {
addValidOperationsAfter4(bugReport);
} else {
addValidOperationsBefore4(bugReport);
@@ -959,14 +922,14 @@ public class RepositoryConfiguration implements Serializable {
TaskAttribute attrResolvedInput = attribute.getTaskData().getRoot().createAttribute(op.getInputId());
attrResolvedInput.getMetaData().setType(op.getInputType());
attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, op.getInputId());
- for (String resolution : getResolutions()) {
+ for (String resolution : getOptionValues(BugzillaAttribute.RESOLUTION)) {
// DUPLICATE and MOVED have special meanings so do not show as resolution
if (resolution.compareTo("DUPLICATE") != 0 && resolution.compareTo("MOVED") != 0) { //$NON-NLS-1$ //$NON-NLS-2$
attrResolvedInput.putOption(resolution, resolution);
}
}
- if (getResolutions().size() > 0) {
- attrResolvedInput.setValue(getResolutions().get(0));
+ if (getOptionValues(BugzillaAttribute.RESOLUTION).size() > 0) {
+ attrResolvedInput.setValue(getOptionValues(BugzillaAttribute.RESOLUTION).get(0));
}
} else if (op.toString().equals(BugzillaOperation.verify_with_resolution.toString()) && op.getInputId() != null) {
TaskAttribute attributeResolution = bugReport.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
@@ -976,13 +939,13 @@ public class RepositoryConfiguration implements Serializable {
TaskAttribute attrResolvedInput = attribute.getTaskData().getRoot().createAttribute(op.getInputId());
attrResolvedInput.getMetaData().setType(op.getInputType());
attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, op.getInputId());
- for (String resolution : getResolutions()) {
+ for (String resolution : getOptionValues(BugzillaAttribute.RESOLUTION)) {
// DUPLICATE and MOVED have special meanings so do not show as resolution
if (resolution.compareTo("DUPLICATE") != 0 && resolution.compareTo("MOVED") != 0) { //$NON-NLS-1$ //$NON-NLS-2$
attrResolvedInput.putOption(resolution, resolution);
}
}
- if (getResolutions().size() > 0) {
+ if (getOptionValues(BugzillaAttribute.RESOLUTION).size() > 0) {
attrResolvedInput.setValue(oldResolutionValue);
}
} else if (op.toString().equals(BugzillaOperation.close_with_resolution.toString()) && op.getInputId() != null) {
@@ -991,14 +954,14 @@ public class RepositoryConfiguration implements Serializable {
TaskAttribute attrResolvedInput = attribute.getTaskData().getRoot().createAttribute(op.getInputId());
attrResolvedInput.getMetaData().setType(op.getInputType());
attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, op.getInputId());
- for (String resolution : getResolutions()) {
+ for (String resolution : getOptionValues(BugzillaAttribute.RESOLUTION)) {
// DUPLICATE and MOVED have special meanings so do not show as resolution
if (resolution.compareTo("DUPLICATE") != 0 && resolution.compareTo("MOVED") != 0) { //$NON-NLS-1$ //$NON-NLS-2$
attrResolvedInput.putOption(resolution, resolution);
}
}
- if (getResolutions().size() > 0) {
- attrResolvedInput.setValue(getResolutions().get(0));
+ if (getOptionValues(BugzillaAttribute.RESOLUTION).size() > 0) {
+ attrResolvedInput.setValue(getOptionValues(BugzillaAttribute.RESOLUTION).get(0));
}
} else if (op.toString() == BugzillaOperation.duplicate.toString()) {
@@ -1204,8 +1167,9 @@ public class RepositoryConfiguration implements Serializable {
public String getStartStatus() {
if (validTransitions == null) {
return version.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0
- || !(getStatusValues().contains(BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) || getStatusValues().contains(
- BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
+ || !(getOptionValues(BugzillaAttribute.BUG_STATUS).contains(
+ BUGZILLA_REPORT_STATUS_4_0.IN_PROGRESS.toString()) || getOptionValues(
+ BugzillaAttribute.BUG_STATUS).contains(BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString()))
? IBugzillaConstants.BUGZILLA_REPORT_STATUS.NEW.toString()
: IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.CONFIRMED.toString();
} else {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index e1e4147b2..d36957602 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -417,7 +417,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
public void updateConfiguration(IProgressMonitor monitor, RepositoryConfiguration repositoryConfiguration,
String fileName) throws CoreException {
repositoryConfiguration.setValidTransitions(monitor, fileName, this);
- if (!repositoryConfiguration.getProducts().isEmpty()) {
+ if (!repositoryConfiguration.getOptionValues(BugzillaAttribute.PRODUCT).isEmpty()) {
updateProductInfo(monitor, repositoryConfiguration);
}
}

Back to the top