diff options
author | Thomas Watson | 2014-07-14 14:07:13 +0000 |
---|---|---|
committer | Thomas Watson | 2014-07-16 17:56:57 +0000 |
commit | 13f131ad9708ba8d0633d48c49ef3a06c4910ef3 (patch) | |
tree | b975a07020b797d829330b5316e931bec24909c8 /bundles | |
parent | 08f5fe9a3500984ca3a20a0a99e468dead3b2247 (diff) | |
download | rt.equinox.framework-13f131ad9708ba8d0633d48c49ef3a06c4910ef3.tar.gz rt.equinox.framework-13f131ad9708ba8d0633d48c49ef3a06c4910ef3.tar.xz rt.equinox.framework-13f131ad9708ba8d0633d48c49ef3a06c4910ef3.zip |
Bug 438904 - Global buddy class loading is not working for packages in aM20140806-0900M20140731-1200M20140730-0800M20140723-0800
fragment
- fix by checking for fragment wiring and using host wirings instead
Diffstat (limited to 'bundles')
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java index 46d941b98..04d573372 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/legacy/PackageAdminImpl.java @@ -115,8 +115,27 @@ public class PackageAdminImpl implements PackageAdmin { for (BundleCapability capability : packageCaps) { ModuleWiring wiring = (ModuleWiring) capability.getRevision().getWiring(); if (wiring != null) { - if (!wiring.getSubstitutedNames().contains(capability.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE))) { - result.add(new ExportedPackageImpl((ModuleCapability) capability, wiring)); + Collection<ModuleWiring> wirings = Collections.emptyList(); + if ((capability.getRevision().getTypes() & BundleRevision.TYPE_FRAGMENT) != 0) { + // This is a fragment, just get all the host wirings + List<ModuleWire> hostWires = wiring.getRequiredModuleWires(HostNamespace.HOST_NAMESPACE); + if (hostWires != null && !hostWires.isEmpty()) { + wirings = new ArrayList<ModuleWiring>(hostWires.size()); + for (ModuleWire hostWire : hostWires) { + ModuleWiring hostWiring = hostWire.getProviderWiring(); + if (hostWiring != null) { + wirings.add(hostWiring); + } + } + } + } else { + // just a single host wiring + wirings = Collections.singletonList(wiring); + } + for (ModuleWiring moduleWiring : wirings) { + if (!moduleWiring.getSubstitutedNames().contains(capability.getAttributes().get(PackageNamespace.PACKAGE_NAMESPACE))) { + result.add(new ExportedPackageImpl((ModuleCapability) capability, moduleWiring)); + } } } } |