Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-10-30 07:10:25 -0400
committerSteffen Pingel2013-11-13 05:36:45 -0500
commitd5552ceee2c98162b5f7fc6a349e2560ff7ef321 (patch)
tree6b8a1f0df5f349ef5dcb567dd72155d882d00516
parentea0c936844574443fbd327b9c2f33927cab2eb83 (diff)
downloadorg.eclipse.mylyn.tasks-e_4_3_m_3_9_x.tar.gz
org.eclipse.mylyn.tasks-e_4_3_m_3_9_x.tar.xz
org.eclipse.mylyn.tasks-e_4_3_m_3_9_x.zip
419190: ClassCastException when opening query dialogR_3_9_2e_4_3_m_3_9_x
Call methods on Wizard only if given IWizard is an instance of Wizard, in other words check type before casting. Bug: 419190 Change-Id: Ie462e542ecec0d443ab7865d9297e63fa4d9aa93 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=419190
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewQueryAction.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java4
3 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryAction.java
index 92e313265..93326e676 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryAction.java
@@ -106,7 +106,9 @@ public class AddRepositoryAction extends Action {
if (messageDialog.getReturnCode() == IDialogConstants.YES_ID) {
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
IWizard queryWizard = connectorUi.getQueryWizard(taskRepository, null);
- ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
+ if (queryWizard instanceof Wizard) {
+ ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
+ }
WizardDialog queryDialog = new WizardDialog(shell, queryWizard);
queryDialog.create();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewQueryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewQueryAction.java
index adf9faa3e..15d7f740c 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewQueryAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewQueryAction.java
@@ -77,7 +77,9 @@ public class NewQueryAction extends Action implements IViewActionDelegate, IExec
TaskRepository taskRepository = TasksUiUtil.getSelectedRepository();
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
wizard = connectorUi.getQueryWizard(taskRepository, null);
- ((Wizard) wizard).setForcePreviousAndNextButtons(true);
+ if (wizard instanceof Wizard) {
+ ((Wizard) wizard).setForcePreviousAndNextButtons(true);
+ }
if (connectorUi instanceof LocalRepositoryConnectorUi) {
wizard.performFinish();
return;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
index d25488b18..2c446f24b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/NewRepositoryWizard.java
@@ -157,7 +157,9 @@ public class NewRepositoryWizard extends Wizard implements INewWizard {
if (messageDialog.getReturnCode() == IDialogConstants.YES_ID) {
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskRepository.getConnectorKind());
final IWizard queryWizard = connectorUi.getQueryWizard(taskRepository, null);
- ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
+ if (queryWizard instanceof Wizard) {
+ ((Wizard) queryWizard).setForcePreviousAndNextButtons(true);
+ }
// execute delayed to avoid stacking dialogs
getShell().getDisplay().asyncExec(new Runnable() {

Back to the top