Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2009-03-06 16:58:18 +0000
committerJohn Arthorne2009-03-06 16:58:18 +0000
commit277fd5efc3648a2556f6ee72e3696404e339ff3f (patch)
tree0516d0590ecb97e61c2f672143d065937cc1e036 /bundles
parent16d046515705f9328e56ba3ed14778305a42a686 (diff)
downloadrt.equinox.p2-277fd5efc3648a2556f6ee72e3696404e339ff3f.tar.gz
rt.equinox.p2-277fd5efc3648a2556f6ee72e3696404e339ff3f.tar.xz
rt.equinox.p2-277fd5efc3648a2556f6ee72e3696404e339ff3f.zip
Bug 267139 Ensure repository is not lost on refresh failure
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java
index bb5fefaa9..df5002d62 100644
--- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/AbstractRepositoryManager.java
@@ -176,14 +176,16 @@ public abstract class AbstractRepositoryManager implements IRepositoryManager, P
//remove the repository so event is broadcast and repositories can clear their caches
if (!removeRepository(location))
fail(location, ProvisionException.REPOSITORY_NOT_FOUND);
+ boolean loaded = false;
try {
IRepository result = loadRepository(location, monitor, null, 0);
+ loaded = true;
setEnabled(location, wasEnabled);
return result;
- } catch (ProvisionException e) {
+ } finally {
//if we failed to load, make sure the repository is not lost
- addRepository(location, wasEnabled, true);
- throw e;
+ if (!loaded)
+ addRepository(location, wasEnabled, true);
}
}

Back to the top