commit | 9819f1c8eeeb8ad2e8c6a4f4521ba69da37615b3 | [log] [tgz] |
---|---|---|
author | Richard S. Hall <rickhall@apache.org> | Mon Mar 15 23:28:23 2010 +0000 |
committer | Richard S. Hall <rickhall@apache.org> | Mon Mar 15 23:28:23 2010 +0000 |
tree | 2b619636a61f8842542c88401d7369a8a43aaf86 | |
parent | e448f8514d81db4fefad8ffb9d0f4684f7337cfc [diff] |
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; }