Port improved FELIX-3465 patch from resolver to framework.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1342752 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
index 8008cd6..43e475b 100644
--- a/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
@@ -510,9 +510,17 @@
cycle.add(revision);
// Make sure package space hasn't already been calculated.
- if (revisionPkgMap.containsKey(revision))
+ Packages revisionPkgs = revisionPkgMap.get(revision);
+ if (revisionPkgs != null)
{
- return;
+ if (revisionPkgs.m_isCalculated)
+ {
+ return;
+ }
+ else
+ {
+ revisionPkgs.m_isCalculated = true;
+ }
}
// Create parallel arrays for requirement and proposed candidate
@@ -602,7 +610,7 @@
// First, add all exported packages to the target revision's package space.
calculateExportedPackages(revision, allCandidates, revisionPkgMap);
- Packages revisionPkgs = revisionPkgMap.get(revision);
+ revisionPkgs = revisionPkgMap.get(revision);
// Second, add all imported packages to the target revision's package space.
for (int i = 0; i < reqs.size(); i++)
@@ -1766,6 +1774,7 @@
public final Map<String, List<Blame>> m_importedPkgs = new HashMap();
public final Map<String, List<Blame>> m_requiredPkgs = new HashMap();
public final Map<String, List<Blame>> m_usedPkgs = new HashMap();
+ public boolean m_isCalculated = false;
public Packages(BundleRevision revision)
{