summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Pingel2012-09-10 14:08:04 (EDT)
committer Steffen Pingel2012-09-10 14:08:04 (EDT)
commit720679b020263796d08e88c9c6886d3a95ee50c5 (patch)
tree9817bec74df99aea2fe4a743f93ffb09488d1aa8
parente5ad94034139306fc1af21602f54a3e8a712b57a (diff)
downloadorg.eclipse.mylyn.tasks-720679b020263796d08e88c9c6886d3a95ee50c5.zip
org.eclipse.mylyn.tasks-720679b020263796d08e88c9c6886d3a95ee50c5.tar.gz
org.eclipse.mylyn.tasks-720679b020263796d08e88c9c6886d3a95ee50c5.tar.bz2
380773: fix ConcurrentModificationException when changing repositoryrefs/changes/05/7705/1
settings Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=380773 Change-Id: I255d39f10eb37461b7f1f056b1d204f4a2069ba0
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java28
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java31
2 files changed, 9 insertions, 50 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
index fcf6a91..f121b5d 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java
@@ -19,17 +19,11 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryChangeListener;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryChangeEvent;
-import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta;
-import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryDelta.Type;
-import org.eclipse.mylyn.internal.tasks.core.sync.UpdateRepositoryConfigurationJob;
import org.eclipse.mylyn.tasks.core.IRepositoryListener;
import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.sync.TaskJob;
/**
* @author Steffen Pingel
@@ -99,27 +93,7 @@ public class BugzillaClientManager implements IRepositoryListener, IRepositoryCh
@SuppressWarnings("restriction")
public void repositoryChanged(TaskRepositoryChangeEvent event) {
- Type type = event.getDelta().getType();
- if (type == TaskRepositoryDelta.Type.PROPERTY) {
- Object key = event.getDelta().getKey();
- if (IBugzillaConstants.BUGZILLA_USE_XMLRPC.equals(key)
- || IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE.equals(key)) {
- final TaskRepository repository = event.getRepository();
- TaskJob updateJob = new UpdateRepositoryConfigurationJob(
- Messages.BugzillaClientManager_Refreshing_repository_configuration, repository, connector);
- updateJob.setPriority(Job.INTERACTIVE);
- updateJob.addJobChangeListener(repositoryConfigurationUpdateJobChangeAdapter);
- updateJob.addJobChangeListener(new JobChangeAdapter() {
- @Override
- public void done(IJobChangeEvent event) {
- synchronized (repository) {
- repository.setUpdating(false);
- }
- }
- });
- updateJob.schedule();
- }
- }
+ // ignore
}
public void setRepositoryConfigurationUpdateJobChangeAdapter(
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
index 57a7116..f1637b2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java
@@ -25,14 +25,11 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientFactory;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCorePlugin;
@@ -49,6 +46,7 @@ import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.RepositoryStatus;
import org.eclipse.mylyn.tasks.core.RepositoryTemplate;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.sync.TaskJob;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage;
import org.eclipse.swt.SWT;
@@ -558,26 +556,9 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
}
applyToInternal(repository);
if (changed) {
- final String jobName = MessageFormat.format(
- Messages.BugzillaRepositorySettingsPage_Updating_repository_configuration_for_X,
- repository.getRepositoryUrl());
- Job updateJob = new Job(jobName) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- monitor.beginTask(jobName, IProgressMonitor.UNKNOWN);
- try {
- performUpdate(repository, connector, monitor);
- } finally {
- monitor.done();
- }
- return Status.OK_STATUS;
- }
- };
- // show the progress in the system task bar if this is a user job (i.e. forced)
- updateJob.setProperty(WorkbenchUtil.SHOW_IN_TASKBAR_ICON_PROPERTY, Boolean.TRUE);
- updateJob.setUser(true);
- updateJob.schedule();
-
+ TaskJob job = TasksUiInternal.getJobFactory().createUpdateRepositoryConfigurationJob(connector, repository,
+ null);
+ job.schedule();
}
}
@@ -594,6 +575,10 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa
return s1.equals(s2);
}
+ /**
+ * @deprecated this method will be removed in 3.9
+ */
+ @Deprecated
public void performUpdate(final TaskRepository repository, final AbstractRepositoryConnector connector,
IProgressMonitor monitor) {
try {