Apply patch (FELIX-3458) to allow generic to hava a wire where the providing
resource is the same as the requiring resources (i.e., it wires to itself).
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1336820 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
index eb0f0a9..556bf36 100644
--- a/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
+++ b/resolver/src/main/java/org/apache/felix/resolver/ResolverImpl.java
@@ -1528,8 +1528,11 @@
if ((cands != null) && (cands.size() > 0))
{
Capability cand = cands.get(0);
- // Ignore resources that import themselves.
- if (!resource.equals(cand.getResource()))
+ // Do not create wires for the osgi.wiring.* namespaces
+ // if the provider and requirer are the same resource;
+ // allow such wires for non-OSGi wiring namespaces.
+ if (!cand.getNamespace().startsWith("osgi.wiring.")
+ || !resource.equals(cand.getResource()))
{
if (!rc.getWirings().containsKey(cand.getResource()))
{