felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r915363 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Date Tue, 23 Feb 2010 14:57:25 GMT
Author: gnodet
Date: Tue Feb 23 14:57:25 2010
New Revision: 915363

URL: http://svn.apache.org/viewvc?rev=915363&view=rev
Log:
FELIX-2126: Dependencies of optional resources should be optional

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

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java?rev=915363&r1=915362&r2=915363&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Tue Feb 23 14:57:25 2010
@@ -176,7 +176,7 @@
             {
                 fake.addRequire((Requirement) iter.next());
             }
-            if (!resolve(fake, locals, remotes))
+            if (!resolve(fake, locals, remotes, false))
             {
                 result = false;
             }
@@ -185,7 +185,7 @@
         // Loop through each resource in added list and resolve.
         for (Iterator iter = m_addedSet.iterator(); iter.hasNext(); )
         {
-            if (!resolve((Resource) iter.next(), locals, remotes))
+            if (!resolve((Resource) iter.next(), locals, remotes, false))
             {
                 // If any resource does not resolve, then the
                 // entire result will be false.
@@ -204,7 +204,7 @@
         return result;
     }
 
-    private boolean resolve(Resource resource, Resource[] locals, Resource[] remotes)
+    private boolean resolve(Resource resource, Resource[] locals, Resource[] remotes, boolean
optional)
     {
         boolean result = true;
 
@@ -246,7 +246,7 @@
                             Capability bestCapability = getBestCandidate(candidateCapabilities);
 
                             // Try to resolve the best resource.
-                            if (resolve(((CapabilityImpl) bestCapability).getResource(),
locals, remotes))
+                            if (resolve(((CapabilityImpl) bestCapability).getResource(),
locals, remotes, optional || reqs[reqIdx].isOptional()))
                             {
                                 candidate = ((CapabilityImpl) bestCapability).getResource();
                             }
@@ -282,11 +282,11 @@
                 {
 
                     // Try to resolve the candidate.
-                    if (resolve(candidate, locals, remotes))
+                    if (resolve(candidate, locals, remotes, optional || reqs[reqIdx].isOptional()))
                     {
                         // The resolved succeeded; record the candidate
                         // as either optional or required.
-                        if (reqs[reqIdx].isOptional())
+                        if (optional || reqs[reqIdx].isOptional())
                         {
                             m_optionalSet.add(candidate);
                         }



Mime
View raw message