diff options
author | gjoranv <gv@verizonmedia.com> | 2023-01-06 10:49:29 +0100 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2023-01-10 10:34:15 +0100 |
commit | e258f2b5a8ae14ea139cdf7134a24c64915aad77 (patch) | |
tree | a7a4b1b61ffc1137dd9c2841591b1d295eb235db /container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java | |
parent | 6094261a5d455ac4cc064508226b8f03caf69da8 (diff) |
Don't attempt to lookup class in internal bundles if a bundle was explicitly specified.
(Only for the felix framework. Internal test frameworks still load
classes from the system bundles only.)
Diffstat (limited to 'container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java')
-rw-r--r-- | container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java index 4acdc3d544b..11041f6a5c0 100644 --- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java +++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java @@ -62,6 +62,11 @@ public class OsgiImpl implements Osgi { if (bundle != null) { return resolveFromBundle(spec, bundle); } else { + if (jdiscOsgi.isFelixFramework() && ! spec.bundle.equals(spec.classId)) { + // Bundle was explicitly specified, but not found. + throw new IllegalArgumentException("Could not find bundle " + spec.bundle + + ". " + bundleResolutionErrorMessage(spec.bundle)); + } return resolveFromThisBundleOrSystemBundle(spec); } } |