diff options
author | Arnstein Ressem <aressem@gmail.com> | 2023-01-06 15:09:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 15:09:17 +0100 |
commit | 64e9d534287593e7be365973a5d1084298a65f3e (patch) | |
tree | 25a48348d6af7c15af7ceeefd5f2fb7f9cd07d12 /container-core/src/main/java/com/yahoo/osgi | |
parent | 55fb144ec32fdcdcf42535fcf27d404aece9594b (diff) |
Revert "Improve user friendliness when class resolution fails."
Diffstat (limited to 'container-core/src/main/java/com/yahoo/osgi')
-rw-r--r-- | container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java | 20 |
1 files changed, 5 insertions, 15 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 156fa4ab074..2c7a0c2b86b 100644 --- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java +++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java @@ -62,18 +62,13 @@ 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); } } /** - * Tries to resolve the given class from this class' bundle. - * If unsuccessful, resolves the class from the system bundle (jdisc_core). + * Tries to resolve the given class from this class' bundle classloader. + * If unsuccessful, resolves the class from . */ @SuppressWarnings("unchecked") private Class<Object> resolveFromThisBundleOrSystemBundle(BundleInstantiationSpecification spec) { @@ -91,14 +86,9 @@ public class OsgiImpl implements Osgi { } } throw new IllegalArgumentException( - "Could not create a component with class '" + spec.classId.getName() + - "'. Tried to load class directly, since no bundle was found for spec: " + spec.bundle + - ". " + bundleResolutionErrorMessage(spec.bundle)); - } - - protected String bundleResolutionErrorMessage(ComponentSpecification bundleSpec) { - return " If a bundle with the same name is installed, there is a either a version mismatch " + - "or the installed bundle's version contains a qualifier string."; + "Could not create a component with id '" + spec.classId.getName() + "'. Tried to load class directly, " + + "since no bundle was found for spec: " + spec.bundle + ". If a bundle with the same name is installed, " + + "there is a either a version mismatch or the installed bundle's version contains a qualifier string."); } @SuppressWarnings("unchecked") |