Applied patch (FELIX-999) to avoid starting fragment bundles.


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@758720 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
index aacc8eb..c9b17de 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
@@ -496,7 +496,11 @@
                         // started later.
                         if (doStartBundle)
                         {
-                            startList.add(localResource.getBundle());
+                            Bundle bundle = localResource.getBundle();
+                            if (!isFragmentBundle(bundle)) 
+                            {
+                                startList.add(bundle);
+                            }
                         }
                     }
                     catch (Exception ex)
@@ -531,7 +535,10 @@
                         // started later.
                         if (start)
                         {
-                            startList.add(bundle);
+                            if (!isFragmentBundle(bundle)) 
+                            {
+                                startList.add(bundle);    
+                            }
                         }
                     }
                 }
@@ -562,6 +569,17 @@
         }
     }
 
+    /**
+     * Determines if the given bundle is a fragement bundle.
+     * 
+     * @param bundle bundle to check
+     * @return flag indicating if the given bundle is a fragement
+     */
+    private boolean isFragmentBundle(Bundle bundle) 
+    {
+        return bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null;
+    }
+    
     private void addReason(Resource resource, Requirement req)
     {
         Requirement[] reasons = (Requirement[]) m_reasonMap.get(resource);