Fix a regression, PackageAdmin.getHosts() should return null. (FELIX-2035)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@923505 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/PackageAdminImpl.java b/framework/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
index d828570..b0fcd16 100644
--- a/framework/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/PackageAdminImpl.java
@@ -220,10 +220,8 @@
         if (getBundleType(bundle) == BUNDLE_TYPE_FRAGMENT)
         {
             List<Bundle> hosts = m_felix.getDependentBundles((BundleImpl) bundle);
-            if (hosts != null)
-            {
-                return hosts.toArray(new Bundle[hosts.size()]);
-            }
+            return ((hosts != null) && (hosts.size() > 0))
+                ? hosts.toArray(new Bundle[hosts.size()]) : null;
         }
         return null;
     }