LOG.warn("Bundle dependency loop detected: {}", stack.subList(stack.indexOf(bundle), stack.size()));
return;
}
stack.add(bundle);
BundleWiring wiring = bundle.adapt(BundleWiring.class);
List<BundleWire> wires;
wires = wiring.getRequiredWires(BundleRevision.PACKAGE_NAMESPACE);
for (BundleWire wire : wires) {
Bundle wiredBundle = wire.getProviderWiring().getBundle();
// examine wires to other application bundles only
if (wiredBundle != bundle && applicationBundles.contains(wiredBundle)) {
sortDependentBundles(wiredBundle, sortedBundles, stack);
}
}
wires = wiring.getRequiredWires(BundleRevision.BUNDLE_NAMESPACE);
for (BundleWire wire : wires) {
Bundle wiredBundle = wire.getProviderWiring().getBundle();
// examine wires to other application bundles only
if (wiredBundle != bundle && applicationBundles.contains(wiredBundle)) {
sortDependentBundles(wiredBundle, sortedBundles, stack);