Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-01-08 19:57:45 +0000
committerfbecker2011-01-08 19:57:45 +0000
commitd9227a02a931887fe7d48c7eff6b4358198ce9ae (patch)
tree4ae147d820c37545e5c650edcbabe66de8fe1220
parent2f4fd45f890c4fa2a6641588eefdb09b10d1e847 (diff)
downloadorg.eclipse.mylyn.tasks-d9227a02a931887fe7d48c7eff6b4358198ce9ae.tar.gz
org.eclipse.mylyn.tasks-d9227a02a931887fe7d48c7eff6b4358198ce9ae.tar.xz
org.eclipse.mylyn.tasks-d9227a02a931887fe7d48c7eff6b4358198ce9ae.zip
ASSIGNED - bug 333075: Updating of repo configuration failed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=333075
-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..10c160c32 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