felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r919203 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Date Thu, 04 Mar 2010 22:12:03 GMT
Author: rickhall
Date: Thu Mar  4 22:12:02 2010
New Revision: 919203

URL: http://svn.apache.org/viewvc?rev=919203&view=rev
Log:
Check if we are able to permutate before doing it. (FELIX-2037)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java?rev=919203&r1=919202&r2=919203&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Thu Mar  4 22:12:02 2010
@@ -1213,14 +1213,16 @@
             // Permutate the candidate map.
             for (int reqIdx = 0; reqIdx < currentBlame.m_reqs.size(); reqIdx++)
             {
-                Map<Requirement, Set<Capability>> copy = copyCandidateMap(candidateMap);
-                Set<Capability> candidates = copy.get(currentBlame.m_reqs.get(reqIdx));
-                Iterator it = candidates.iterator();
-                it.next();
-                it.remove();
-                // TODO: PROTO3 RESOLVER - We could check before doing the candidate map
copy.
-                if (candidates.size() > 0)
+                // Verify whether we have more than one candidate to create
+                // a permutation.
+                Set<Capability> candidates = candidateMap.get(currentBlame.m_reqs.get(reqIdx));
+                if (candidates.size() > 1)
                 {
+                    Map<Requirement, Set<Capability>> copy = copyCandidateMap(candidateMap);
+                    candidates = copy.get(currentBlame.m_reqs.get(reqIdx));
+                    Iterator it = candidates.iterator();
+                    it.next();
+                    it.remove();
                     m_candidatePermutations.add(copy);
                 }
             }



Mime
View raw message