Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-11-30 04:21:44 -0500
committerPascal Rapicault2016-10-30 20:52:59 -0400
commit6159101286982241da9e40a95c89e681af218c5a (patch)
tree60849a79ea852498c71a87edae573dd00a83cda0
parent01c4576ff90109da8f88010434b2a55a5b5c1e61 (diff)
downloadrt.equinox.p2-6159101286982241da9e40a95c89e681af218c5a.tar.gz
rt.equinox.p2-6159101286982241da9e40a95c89e681af218c5a.tar.xz
rt.equinox.p2-6159101286982241da9e40a95c89e681af218c5a.zip
Bug 483286 - NullPointerException in AbstractRepositoryManager.flushCache()
Change-Id: I8e010c2a49d8ce75e5d491201800d38c924dfe91 Signed-off-by: Eike Stepper <stepper@esc-net.de>
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
index 20c0bfb98..0e190c9af 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
@@ -1190,11 +1190,13 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
}
public void flushCache() {
- synchronized (repositories) {
- Collection<RepositoryInfo<T>> repos = repositories.values();
- for (Iterator<RepositoryInfo<T>> iterator = repos.iterator(); iterator.hasNext();) {
- RepositoryInfo<T> repositoryInfo = iterator.next();
- repositoryInfo.repository = null;
+ synchronized (repositoryLock) {
+ if (repositories != null) {
+ Collection<RepositoryInfo<T>> repos = repositories.values();
+ for (Iterator<RepositoryInfo<T>> iterator = repos.iterator(); iterator.hasNext();) {
+ RepositoryInfo<T> repositoryInfo = iterator.next();
+ repositoryInfo.repository = null;
+ }
}
}
}

Back to the top