Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-06-12 20:57:07 +0000
committerspingel2009-06-12 20:57:07 +0000
commit85bd8904616c81d8deffd57f55a42a934fa31c7e (patch)
tree04058018dffc10385a2b3829cfb1fd8e103bc260
parentdc05e70ca093d873d0ea20e8ba4b64265c716dfe (diff)
downloadorg.eclipse.mylyn.tasks-85bd8904616c81d8deffd57f55a42a934fa31c7e.tar.gz
org.eclipse.mylyn.tasks-85bd8904616c81d8deffd57f55a42a934fa31c7e.tar.xz
org.eclipse.mylyn.tasks-85bd8904616c81d8deffd57f55a42a934fa31c7e.zip
NEW - bug 280121: guard against exceptions when instantiating connectors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=280121
-rw-r--r--org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/SupportHandlerManager.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LocalTaskEditorContributionDescriptor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionPartDescriptor.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionReader.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java17
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java12
6 files changed, 16 insertions, 26 deletions
diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/SupportHandlerManager.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/SupportHandlerManager.java
index 8d5272d68..961ec948d 100644
--- a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/SupportHandlerManager.java
+++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/SupportHandlerManager.java
@@ -14,7 +14,6 @@ package org.eclipse.mylyn.internal.tasks.bugs;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
@@ -139,7 +138,7 @@ public class SupportHandlerManager {
"Could not load task contributor extenstion: \"" + object.getClass().getCanonicalName() + "\"" //$NON-NLS-1$ //$NON-NLS-2$
+ " does not implement \"" + AbstractSupportHandler.class.getCanonicalName() + "\"")); //$NON-NLS-1$ //$NON-NLS-2$
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.WARNING, TasksBugsPlugin.ID_PLUGIN,
"Could not load task contributor extension", e)); //$NON-NLS-1$
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LocalTaskEditorContributionDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LocalTaskEditorContributionDescriptor.java
index 3f68d6dce..4c3bc0f0e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LocalTaskEditorContributionDescriptor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/LocalTaskEditorContributionDescriptor.java
@@ -31,7 +31,7 @@ public class LocalTaskEditorContributionDescriptor {
try {
return (AbstractLocalEditorPart) element.createExecutableExtension("class"); //$NON-NLS-1$
} catch (Exception e) {
- throw new IllegalArgumentException(e);
+ throw new RuntimeException(e);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionPartDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionPartDescriptor.java
index c7958ac23..97be3cf3f 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionPartDescriptor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionPartDescriptor.java
@@ -40,7 +40,7 @@ public class TaskEditorExtensionPartDescriptor extends TaskEditorPartDescriptor
try {
return (AbstractTaskEditorPart) element.createExecutableExtension(ATTR_CLASS);
} catch (Exception e) {
- throw new IllegalArgumentException(e);
+ throw new RuntimeException(e);
}
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionReader.java
index 3c1ff3004..5ad55a712 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionReader.java
@@ -11,7 +11,6 @@
package org.eclipse.mylyn.internal.tasks.ui.editors;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
@@ -63,10 +62,7 @@ public class TaskEditorExtensionReader {
String name = element.getAttribute(ATTR_NAME);
AbstractTaskEditorExtension extension = (AbstractTaskEditorExtension) element.createExecutableExtension("class"); //$NON-NLS-1$
TaskEditorExtensions.addTaskEditorExtension(element.getNamespaceIdentifier(), id, name, extension);
- } catch (CoreException e) {
- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load taskEditorExtension", //$NON-NLS-1$
- e));
- } catch (Exception e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load taskEditorExtension", //$NON-NLS-1$
e));
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
index c14e6c357..8a5badaad 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TasksUiExtensionReader.java
@@ -14,7 +14,6 @@ package org.eclipse.mylyn.internal.tasks.ui.util;
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
@@ -251,7 +250,7 @@ public class TasksUiExtensionReader {
}
TaskListView.addPresentation(presentation);
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load presentation extension", e)); //$NON-NLS-1$
}
@@ -269,7 +268,7 @@ public class TasksUiExtensionReader {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load duplicate detector " + obj.getClass().getCanonicalName())); //$NON-NLS-1$
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load duplicate detector", e)); //$NON-NLS-1$
}
}
@@ -285,7 +284,7 @@ public class TasksUiExtensionReader {
"Could not load repository link provider " //$NON-NLS-1$
+ repositoryLinkProvider.getClass().getCanonicalName()));
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load repository link provider", e)); //$NON-NLS-1$
}
@@ -310,7 +309,7 @@ public class TasksUiExtensionReader {
"Could not load editor page factory " + item.getClass().getCanonicalName() + " must implement " //$NON-NLS-1$ //$NON-NLS-2$
+ AbstractTaskEditorPageFactory.class.getCanonicalName()));
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load page editor factory", //$NON-NLS-1$
e));
}
@@ -326,7 +325,7 @@ public class TasksUiExtensionReader {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load connector core " //$NON-NLS-1$
+ connectorCore.getClass().getCanonicalName()));
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load connector core", e)); //$NON-NLS-1$
}
}
@@ -359,7 +358,7 @@ public class TasksUiExtensionReader {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load connector ui " //$NON-NLS-1$
+ connectorUiObject.getClass().getCanonicalName()));
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load connector ui", e)); //$NON-NLS-1$
}
}
@@ -412,7 +411,7 @@ public class TasksUiExtensionReader {
"Could not load dynamic popup menu: " + dynamicPopupContributor.getClass().getCanonicalName() //$NON-NLS-1$
+ " must implement " + IDynamicSubMenuContributor.class.getCanonicalName())); //$NON-NLS-1$
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load dynamic popup menu extension", e)); //$NON-NLS-1$
}
@@ -429,7 +428,7 @@ public class TasksUiExtensionReader {
"Could not load task list migrator migrator: " + migratorObject.getClass().getCanonicalName() //$NON-NLS-1$
+ " must implement " + AbstractTaskListMigrator.class.getCanonicalName())); //$NON-NLS-1$
}
- } catch (CoreException e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
"Could not load task list migrator extension", e)); //$NON-NLS-1$
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
index 650384f63..8ff085b82 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java
@@ -48,10 +48,8 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* An abstract base class for repository settings page that supports the <code>taskRepositoryPageContribution</code>
- * extension point.
- *
- * {@link ITaskRepositoryPage} implementations are encouraged to extend {@link AbstractRepositorySettingsPage} if
- * possible as it provides a standard UI for managing server settings.
+ * extension point. {@link ITaskRepositoryPage} implementations are encouraged to extend
+ * {@link AbstractRepositorySettingsPage} if possible as it provides a standard UI for managing server settings.
*
* @see AbstractRepositorySettingsPage
* @author David Green
@@ -312,9 +310,7 @@ public abstract class AbstractTaskRepositoryPage extends WizardPage implements I
/**
* Validate all settings in the page including contributions. This method should be called whenever a setting is
- * changed on the page.
- *
- * The results of validation are applied and the buttons of the page are updated.
+ * changed on the page. The results of validation are applied and the buttons of the page are updated.
*
* @see #validate(IProgressMonitor)
* @see #applyValidationResult(IStatus[])
@@ -382,7 +378,7 @@ public abstract class AbstractTaskRepositoryPage extends WizardPage implements I
if (pageContributor.isEnabled()) {
contributors.add(pageContributor);
}
- } catch (Exception e) {
+ } catch (Throwable e) {
StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load " //$NON-NLS-1$
+ TASK_REPOSITORY_PAGE_CONTRIBUTION + " '" + id + "' from plug-in " //$NON-NLS-1$//$NON-NLS-2$
+ element.getContributor().getName(), e));

Back to the top