Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2014-02-21 14:16:01 -0500
committerSam Davis2014-03-03 21:41:03 -0500
commit2d0cefb8316d2b0f37474d799c9182b494244cc6 (patch)
tree54c02b48157f2c9daf74afc9787c7fe45d87d06d
parentfaa7ae94c2e9ec77b0af6d8eae9700edfdd32e7e (diff)
downloadorg.eclipse.mylyn.tasks-2d0cefb8316d2b0f37474d799c9182b494244cc6.tar.gz
org.eclipse.mylyn.tasks-2d0cefb8316d2b0f37474d799c9182b494244cc6.tar.xz
org.eclipse.mylyn.tasks-2d0cefb8316d2b0f37474d799c9182b494244cc6.zip
428789: credentials migration job runs on every startup
Change-Id: Ia3c9d1af256639beba11b96d9f43266de646ccfb Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=428789
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 2ebc38160..a059fefe8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -720,6 +720,15 @@ public class TasksUiPlugin extends AbstractUIPlugin {
*/
@SuppressWarnings("deprecation")
private void migrateCredentials(final List<TaskRepository> repositories) {
+ final boolean force = Boolean.parseBoolean(System.getProperty(PROP_FORCE_CREDENTIALS_MIGRATION));
+ final boolean migrateFromSecureStore = force
+ || !getPluginPreferences().getBoolean(PREF_MIGRATED_TASK_REPOSITORIES_FROM_SECURE_STORE);
+ final boolean migrateFromKeyring = (force || !getPluginPreferences().getBoolean(
+ PREF_MIGRATED_TASK_REPOSITORIES_FROM_KEYRING))
+ && isKeyringInstalled();
+ if (!migrateFromSecureStore && !migrateFromKeyring) {
+ return;
+ }
// Use a UI job to ensure the UI has loaded
new UIJob("Credential Migration UI Job") { //$NON-NLS-1$
@Override
@@ -728,18 +737,15 @@ public class TasksUiPlugin extends AbstractUIPlugin {
new Job("Credential Migration") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- boolean force = Boolean.parseBoolean(System.getProperty(PROP_FORCE_CREDENTIALS_MIGRATION));
if (force) {
StatusHandler.log(new Status(IStatus.INFO, ITasksCoreConstants.ID_PLUGIN, NLS.bind(
"Forcing task repository credential migration because system property {0} is set.", //$NON-NLS-1$
PROP_FORCE_CREDENTIALS_MIGRATION)));
}
- if (force
- || !getPluginPreferences().getBoolean(PREF_MIGRATED_TASK_REPOSITORIES_FROM_SECURE_STORE)) {
+ if (migrateFromSecureStore) {
new TaskRepositorySecureStoreMigrator().migrateCredentials(repositories);
}
- if ((force || !getPluginPreferences().getBoolean(PREF_MIGRATED_TASK_REPOSITORIES_FROM_KEYRING))
- && isKeyringInstalled()) {
+ if (migrateFromKeyring) {
new TaskRepositoryKeyringMigrator("", "Basic").migrateCredentials(repositories); //$NON-NLS-1$ //$NON-NLS-2$
}
return Status.OK_STATUS;

Back to the top