felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1342750 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
Date Fri, 25 May 2012 18:08:24 GMT
Author: rickhall
Date: Fri May 25 18:08:24 2012
New Revision: 1342750

URL: http://svn.apache.org/viewvc?rev=1342750&view=rev
Log:
Fix FELIX-3465 patch which was too aggressive in short circuiting
package space calculation as witnessed by the regression reported
by FELIX-3521.

Modified:
    felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java

Modified: felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java?rev=1342750&r1=1342749&r2=1342750&view=diff
==============================================================================
--- felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java (original)
+++ felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java Fri May
25 18:08:24 2012
@@ -525,9 +525,17 @@ public class ResolverImpl implements Res
         cycle.add(resource);
 
         // Make sure package space hasn't already been calculated.
-        if (resourcePkgMap.containsKey(resource))
+        Packages resourcePkgs = resourcePkgMap.get(resource);
+        if (resourcePkgs != null)
         {
-            return;
+            if (resourcePkgs.m_isCalculated)
+            {
+                return;
+            }
+            else
+            {
+                resourcePkgs.m_isCalculated = true;
+            }
         }
 
         // Create parallel arrays for requirement and proposed candidate
@@ -618,7 +626,7 @@ public class ResolverImpl implements Res
 
         // First, add all exported packages to the target resource's package space.
         calculateExportedPackages(rc, resource, allCandidates, resourcePkgMap);
-        Packages resourcePkgs = resourcePkgMap.get(resource);
+        resourcePkgs = resourcePkgMap.get(resource);
 
         // Second, add all imported packages to the target resource's package space.
         for (int i = 0; i < reqs.size(); i++)
@@ -1865,6 +1873,7 @@ public class ResolverImpl implements Res
         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(Resource resource)
         {



Mime
View raw message