diff options
author | Michael Valenta | 2003-11-14 21:32:12 +0000 |
---|---|---|
committer | Michael Valenta | 2003-11-14 21:32:12 +0000 |
commit | 076dde20b6f0acd901076d34e650041abf369190 (patch) | |
tree | acb82c2a4255ba288a340068a3a801e14588a719 | |
parent | e8b1db300183474bba27dc3c8ce0e6df187b2129 (diff) | |
download | eclipse.platform.team-076dde20b6f0acd901076d34e650041abf369190.tar.gz eclipse.platform.team-076dde20b6f0acd901076d34e650041abf369190.tar.xz eclipse.platform.team-076dde20b6f0acd901076d34e650041abf369190.zip |
Avoid logging exceptions when project is deleted
-rw-r--r-- | bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java index 86ce2c35a..9482ae5f2 100644 --- a/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java +++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/core/RepositoryProvider.java @@ -421,11 +421,22 @@ public abstract class RepositoryProvider implements IProjectNature { } } } catch(CoreException e) { - TeamPlugin.log(e); + if (!isAcceptableException(e)) { + TeamPlugin.log(e); + } } return null; } + /* + * Return whether the given exception is acceptable during a getProvider(). + * If the exception is acceptable, it is assumed that there is no provider + * on the project. + */ + private static boolean isAcceptableException(CoreException e) { + return e.getStatus().getCode() == IResourceStatus.RESOURCE_NOT_FOUND; + } + /** * Returns a provider of type with the given id if associated with the given project * or <code>null</code> if the project is not associated with a provider of that type @@ -473,8 +484,9 @@ public abstract class RepositoryProvider implements IProjectNature { } } } catch(CoreException e) { - // would happen if provider nature id is not registered with the resources plugin - TeamPlugin.log(IStatus.WARNING, Policy.bind("RepositoryProviderTypeRepositoryProvider_not_registered_as_a_nature_id___3", id), e); //$NON-NLS-1$ + if (!isAcceptableException(e)) { + TeamPlugin.log(e); + } } return null; } |