Dependents for fragments are calculated differently. (FELIX-2950)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1124295 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java b/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
index 72c28ad..1a397a6 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
@@ -93,7 +93,16 @@
         List<BundleRevision> revisions = bundle.getRevisions();
         for (BundleRevision revision : revisions)
         {
-            if (m_dependentsMap.containsKey(revision))
+            // We have to special case fragments, since their dependencies
+            // are actually reversed (i.e., they require a host, but then
+            // the host ends up dependent on them at run time).
+            if (Util.isFragment(revision)
+                && (revision.getWiring() != null)
+                && !revision.getWiring().getRequiredWires(null).isEmpty())
+            {
+                return true;
+            }
+            else if (m_dependentsMap.containsKey(revision))
             {
                 return true;
             }