felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1690709 - /felix/trunk/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
Date Mon, 13 Jul 2015 15:17:35 GMT
Author: gnodet
Date: Mon Jul 13 15:17:34 2015
New Revision: 1690709

URL: http://svn.apache.org/r1690709
Log:
[FELIX-4942] Avoid one additional call in the stack for each recurtion

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=1690709&r1=1690708&r2=1690709&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 Mon Jul
13 15:17:34 2015
@@ -397,7 +397,7 @@ public class ResolverImpl implements Res
 
             ResolutionError rethrow = checkPackageSpaceConsistency(
                     session, entry.getValue(),
-                    allCandidates, resourcePkgMap, resultCache);
+                    allCandidates, false, resourcePkgMap, resultCache);
             if (rethrow != null)
             {
                 Resource faultyResource = entry.getKey();
@@ -527,9 +527,9 @@ public class ResolverImpl implements Res
 //dumpResourcePkgMap(resourcePkgMap);
 //System.out.println("+++ PACKAGE SPACES END +++");
 
-                        rethrow = checkDynamicPackageSpaceConsistency(session,
+                        rethrow = checkPackageSpaceConsistency(session,
                                 allCandidates.getWrappedHost(host),
-                                allCandidates, resourcePkgMap, new HashMap<Resource, Object>(64));
+                                allCandidates, true, resourcePkgMap, new HashMap<Resource,
Object>(64));
                     }
                     while ((rethrow != null)
                         && ((usesPermutations.size() > 0) || (importPermutations.size()
> 0)));
@@ -1150,24 +1150,14 @@ public class ResolverImpl implements Res
         ResolveSession session,
         Resource resource,
         Candidates allCandidates,
+        boolean dynamic,
         Map<Resource, Packages> resourcePkgMap,
         Map<Resource, Object> resultCache)
     {
-        if (session.getContext().getWirings().containsKey(resource))
+        if (!dynamic && session.getContext().getWirings().containsKey(resource))
         {
             return null;
         }
-        return checkDynamicPackageSpaceConsistency(
-            session, resource, allCandidates, resourcePkgMap, resultCache);
-    }
-
-    private ResolutionError checkDynamicPackageSpaceConsistency(
-        ResolveSession session,
-        Resource resource,
-        Candidates allCandidates,
-        Map<Resource, Packages> resourcePkgMap,
-        Map<Resource, Object> resultCache)
-    {
         Object cache = resultCache.get(resource);
         if (cache != null)
         {
@@ -1437,7 +1427,7 @@ public class ResolverImpl implements Res
                 {
                     rethrow = checkPackageSpaceConsistency(
                             session, cap.getResource(),
-                            allCandidates, resourcePkgMap, resultCache);
+                            allCandidates, false, resourcePkgMap, resultCache);
                     if (rethrow != null)
                     {
                         // If the lower level check didn't create any permutations,



Mime
View raw message