diff options
author | Michael Valenta | 2005-04-29 16:11:58 +0000 |
---|---|---|
committer | Michael Valenta | 2005-04-29 16:11:58 +0000 |
commit | 23792c69ecd51a0e19b73b2a8fb847e0b0bc625c (patch) | |
tree | a9a71add64b26303a5b6ee483ac685927bf47a45 /bundles/org.eclipse.team.ui | |
parent | 9dbe5f4b8deacc62598adeca915b26f5ef4cb168 (diff) | |
download | eclipse.platform.team-23792c69ecd51a0e19b73b2a8fb847e0b0bc625c.tar.gz eclipse.platform.team-23792c69ecd51a0e19b73b2a8fb847e0b0bc625c.tar.xz eclipse.platform.team-23792c69ecd51a0e19b73b2a8fb847e0b0bc625c.zip |
Fixed ClassCastException
Diffstat (limited to 'bundles/org.eclipse.team.ui')
-rw-r--r-- | bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java index 583cfb865..92f2b9e0d 100644 --- a/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java +++ b/bundles/org.eclipse.team.ui/src/org/eclipse/team/internal/ui/TeamCapabilityHelper.java @@ -38,13 +38,6 @@ public class TeamCapabilityHelper { */ private static TeamCapabilityHelper singleton; - /* - * This is copied from RepositoryProviderType to provide a quick way to query if - * a project is mapped to a provider id. - */ - private final static QualifiedName PROVIDER_PROP_KEY = - new QualifiedName("org.eclipse.team.core", "repository"); //$NON-NLS-1$ //$NON-NLS-2$ - /** * Get the singleton instance of this class. * @return the singleton instance of this class. @@ -151,15 +144,16 @@ public class TeamCapabilityHelper { * @throws CoreException */ public String getProviderIdFor(IProject project) throws CoreException { - String id = null; if(project.isAccessible()) { //First, look for the session property - RepositoryProvider provider = (RepositoryProvider)project.getSessionProperty(PROVIDER_PROP_KEY); - if(provider != null) - id = provider.getID(); + Object prop = project.getSessionProperty(TeamPlugin.PROVIDER_PROP_KEY); + if(prop != null && prop instanceof RepositoryProvider) { + RepositoryProvider provider = (RepositoryProvider) prop; + return provider.getID(); + } //Next, check if it has the ID as a persistent property - id = project.getPersistentProperty(PROVIDER_PROP_KEY); + return project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY); } - return id; + return null; } } |