Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-01-08 20:14:44 +0000
committerfbecker2011-01-08 20:14:44 +0000
commit8cdb47f7346f84339770f72b55f052ec91e09ac3 (patch)
tree8bea04b63a19d2f12a0b3ed1557e5784cf38cc4b /org.eclipse.mylyn.bugzilla.core
parentc0dad89eae1f4474aac339dab699ce8804192b57 (diff)
downloadorg.eclipse.mylyn.tasks-8cdb47f7346f84339770f72b55f052ec91e09ac3.tar.gz
org.eclipse.mylyn.tasks-8cdb47f7346f84339770f72b55f052ec91e09ac3.tar.xz
org.eclipse.mylyn.tasks-8cdb47f7346f84339770f72b55f052ec91e09ac3.zip
ASSIGNED - bug 333075: Updating of repo configuration failed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333075 corrected patch
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java33
1 files changed, 32 insertions, 1 deletions
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 8a55ac06e..1326a67b8 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
@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
@@ -294,6 +295,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
monitor.beginTask(Messages.BugzillaTaskDataHandler_Receiving_tasks, taskIds.size());
BugzillaClient client = connector.getClientManager().getClient(repository, monitor);
final CoreException[] collectionException = new CoreException[1];
+ final Boolean[] updateConfig = new Boolean[1];
class CollectorWrapper extends TaskDataCollector {
@@ -316,7 +318,12 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
try {
initializeTaskData(repository, taskData, null, new SubProgressMonitor(monitor2, 1));
} catch (CoreException e) {
- if (collectionException[0] == null) {
+ // this info CoreException is only used internal
+ if (e.getStatus().getCode() == IStatus.INFO && e.getMessage().contains("Update Config")) { //$NON-NLS-1$
+ if (updateConfig[0] == null) {
+ updateConfig[0] = new Boolean(true);
+ }
+ } else if (collectionException[0] == null) {
collectionException[0] = e;
}
}
@@ -332,6 +339,11 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
if (collectionException[0] != null) {
throw collectionException[0];
}
+ if (updateConfig[0] != null) {
+ SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, 1);
+ client.getRepositoryConfiguration(subMonitor, null);
+ subMonitor.done();
+ }
} catch (IOException e) {
throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
RepositoryStatus.ERROR_IO, repository.getRepositoryUrl(), e));
@@ -445,6 +457,25 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
boolean shortLogin = Boolean.parseBoolean(repository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN));
repositoryConfiguration.configureTaskData(taskData, shortLogin, connector);
}
+ boolean updateConfig = false;
+ for (TaskAttribute taskAttribute : taskData.getRoot().getAttributes().values()) {
+ Map<String, String> opt = taskAttribute.getOptions();
+ if (opt != null && !opt.isEmpty()) {
+ List<String> values = taskAttribute.getValues();
+ for (String value : values) {
+ if (!opt.containsKey(value)) {
+ taskAttribute.putOption(value, value);
+ updateConfig = true;
+ }
+ }
+ }
+ }
+ if (updateConfig) {
+ // this info CoreException is only used internal
+ throw new CoreException(new BugzillaStatus(IStatus.INFO, BugzillaCorePlugin.ID_PLUGIN, IStatus.INFO,
+ repository.getRepositoryUrl(), "Update Config")); //$NON-NLS-1$
+ }
+
} finally {
monitor.done();
}

Back to the top