Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2004-03-23 03:12:34 +0000
committerMichael Valenta2004-03-23 03:12:34 +0000
commitca006b3364e4e70d67a8bc8da944d2ae89d15a86 (patch)
tree556f715c198c0da3e65688fb9843537e37831e46
parent795f273c80177725faf4923861b766c714af1d0b (diff)
downloadeclipse.platform.team-ca006b3364e4e70d67a8bc8da944d2ae89d15a86.tar.gz
eclipse.platform.team-ca006b3364e4e70d67a8bc8da944d2ae89d15a86.tar.xz
eclipse.platform.team-ca006b3364e4e70d67a8bc8da944d2ae89d15a86.zip
53671: ClassCastException opening the synch view
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties1
-rw-r--r--bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java10
2 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
index 5459b5c86..5483234fd 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/messages.properties
@@ -416,3 +416,4 @@ SyncViewerPreferencePage.16=Prompt
GlobalRefreshSchedulePage.0=Configure a scheduled synchronization
GlobalRefreshSchedulePage.1=Synchronize Schedule
GlobalRefreshSchedulePage.2=Set the interval at which the resources associated with {0} will be synchronized in the background.
+SynchronizeManager.18=Could not cast {0} as ISynchronizeView
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
index e4980922d..b2f03e0f3 100644
--- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
+++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/synchronize/SynchronizeManager.java
@@ -25,6 +25,7 @@ import org.eclipse.team.internal.ui.registry.SynchronizeParticipantRegistry;
import org.eclipse.team.ui.ITeamUIConstants;
import org.eclipse.team.ui.synchronize.*;
import org.eclipse.ui.*;
+import org.eclipse.team.internal.ui.Policy;
/**
* Manages the registered synchronize participants. It handles notification of
@@ -325,7 +326,14 @@ public class SynchronizeManager implements ISynchronizeManager {
if (activePage == null)
return null;
}
- return (ISynchronizeView) activePage.showView(ISynchronizeView.VIEW_ID);
+ IViewPart part = activePage.showView(ISynchronizeView.VIEW_ID);
+ try {
+ return (ISynchronizeView) part;
+ } catch (ClassCastException e) {
+ // Strange that we cannot cast the part (see bug 53671)
+ TeamUIPlugin.log(IStatus.ERROR, Policy.bind("SynchronizeManager.18", part.getClass().getName()), e); //$NON-NLS-1$
+ return null;
+ }
} catch (PartInitException pe) {
Utils.handleError(window.getShell(), pe, Policy.bind("SynchronizeView.16"), pe.getMessage()); //$NON-NLS-1$
return null;

Back to the top