felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r1033075 - in /felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3: Proto3Resolver.java WrappedModule.java
Date Tue, 09 Nov 2010 16:34:50 GMT
Author: rickhall
Date: Tue Nov  9 16:34:49 2010
New Revision: 1033075

URL: http://svn.apache.org/viewvc?rev=1033075&view=rev
Log:
Minor edits.

Modified:
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/Proto3Resolver.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/WrappedModule.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=1033075&r1=1033074&r2=1033075&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
Tue Nov  9 16:34:49 2010
@@ -1572,6 +1572,33 @@ System.out.println("+++ FRAGMENTS: " + f
         return copy;
     }
 
+    private static Module getActualModule(Module m)
+    {
+        if (m instanceof WrappedModule)
+        {
+            return ((WrappedModule) m).getWrappedModule();
+        }
+        return m;
+    }
+
+    private static Capability getActualCapability(Capability c)
+    {
+        if (c instanceof WrappedCapability)
+        {
+            return ((WrappedCapability) c).getWrappedCapability();
+        }
+        return c;
+    }
+
+    private static Requirement getActualRequirement(Requirement r)
+    {
+        if (r instanceof WrappedRequirement)
+        {
+            return ((WrappedRequirement) r).getWrappedRequirement();
+        }
+        return r;
+    }
+
     private static Map<Module, List<Wire>> populateWireMap(
         Module module, Map<Module, Packages> modulePkgMap,
         Map<Module, List<Wire>> wireMap, Map<Requirement, Set<Capability>>
candidateMap)
@@ -1607,19 +1634,21 @@ System.out.println("+++ FRAGMENTS: " + f
                         && !module.equals(cand.getModule()))
                     {
                         packageWires.add(
-                            new WireImpl(module,
-                                req,
-                                cand.getModule(),
-                                cand));
+                            new WireImpl(
+                                getActualModule(module),
+                                getActualRequirement(req),
+                                getActualModule(cand.getModule()),
+                                getActualCapability(cand)));
                     }
                     else if (req.getNamespace().equals(Capability.MODULE_NAMESPACE))
                     {
                         Packages candPkgs = modulePkgMap.get(cand.getModule());
                         moduleWires.add(
-                            new WireModuleImpl(module,
-                                req,
-                                cand.getModule(),
-                                cand,
+                            new WireModuleImpl(
+                                getActualModule(module),
+                                getActualRequirement(req),
+                                getActualModule(cand.getModule()),
+                                getActualCapability(cand),
                                 candPkgs.getExportedAndReexportedPackages()));
                     }
                 }
@@ -1641,7 +1670,12 @@ System.out.println("+++ FRAGMENTS: " + f
                         hostWires = new ArrayList<Wire>();
                         wireMap.put(fragment, hostWires);
                     }
-                    hostWires.add(new WireHostImpl(fragment, null, module, null));
+                    hostWires.add(
+                        new WireHostImpl(
+                            getActualModule(fragment),
+                            null,
+                            getActualModule(module),
+                            null));
                 }
             }
         }

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/WrappedModule.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/WrappedModule.java?rev=1033075&r1=1033074&r2=1033075&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/WrappedModule.java
(original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/proto3/WrappedModule.java
Tue Nov  9 16:34:49 2010
@@ -37,8 +37,8 @@ class WrappedModule extends Module
     public WrappedModule(Module module)
     {
         super(module.getName());
-        m_name = module.getName() + " [" + hashCode() + "]";
         m_module = module;
+        m_name = module.getName() + " [" + super.hashCode() + "]";
     }
 
     public Module getWrappedModule()
@@ -129,8 +129,7 @@ class WrappedModule extends Module
                         || reqs.get(reqIdx).getNamespace().equals(Capability.MODULE_NAMESPACE))
                     {
                         reqList.add(
-                            new WrappedRequirement(
-                                this, reqs.get(reqIdx)));
+                            new WrappedRequirement(this, reqs.get(reqIdx)));
                     }
                 }
             }



Mime
View raw message