felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r911719 - /felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
Date Fri, 19 Feb 2010 07:08:18 GMT
Author: rickhall
Date: Fri Feb 19 07:08:18 2010
New Revision: 911719

URL: http://svn.apache.org/viewvc?rev=911719&view=rev
Log:
More work on reexport visibility.

Modified:
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java?rev=911719&r1=911718&r2=911719&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
(original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
Fri Feb 19 07:08:18 2010
@@ -1218,7 +1218,8 @@
             }
             if (!rbReqs.isEmpty())
             {
-                Map<Requirement, Capability> rbMap = new HashMap<Requirement, Capability>();
+                Map<Requirement, List<Capability>> rbMap =
+                    new HashMap<Requirement, List<Capability>>();
 // TODO: FELIX3 - This approach isn't very efficient since it keeps recalculating the
 //       module wire for each package exported by the candidate module.
                 for (Entry<String, List<Blame>> entry : pkgs.m_requiredPkgs.entrySet())
@@ -1229,10 +1230,17 @@
                         {
                             if (blame.m_reqs.get(blame.m_reqs.size() - 1).equals(rbReq))
                             {
+System.out.println("+++ FOUND REQUIRED CAP " + blame.m_cap + " FOR " + rbReq);
                                 List<Capability> moduleCaps =
                                     Util.getCapabilityByNamespace(
                                         blame.m_cap.getModule(), Capability.MODULE_NAMESPACE);
-                                rbMap.put(rbReq, moduleCaps.get(0));
+                                List<Capability> caps = rbMap.get(rbReq);
+                                if (caps == null)
+                                {
+                                    caps = new ArrayList<Capability>();
+                                    rbMap.put(rbReq, caps);
+                                }
+                                caps.add(moduleCaps.get(0));
                                 if (!blame.m_cap.getModule().isResolved())
                                 {
                                     populateWireMap(
@@ -1248,16 +1256,22 @@
                 // correct order, which is required by the spec.
                 for (Requirement rbReq : rbReqs)
                 {
-                    Capability cap = rbMap.get(rbReq);
-                    // Ignore modules that import themselves.
-                    if ((cap != null) && !module.equals(cap.getModule()))
+                    List<Capability> caps = rbMap.get(rbReq);
+                    if (caps != null)
                     {
-                        moduleWires.add(
-                            new WireModuleImpl(module,
-                                rbReq,
-                                cap.getModule(),
-                                cap,
-                                pkgs.getRequiredPackages(cap.getModule())));
+                        for (Capability cap : caps)
+                        {
+                            // Ignore modules that import themselves.
+                            if (!module.equals(cap.getModule()))
+                            {
+                                moduleWires.add(
+                                    new WireModuleImpl(module,
+                                        rbReq,
+                                        cap.getModule(),
+                                        cap,
+                                        pkgs.getRequiredPackages(cap.getModule())));
+                            }
+                        }
                     }
                 }
             }



Mime
View raw message