diff options
author | Thomas Watson | 2019-10-10 18:40:43 +0000 |
---|---|---|
committer | Thomas Watson | 2019-10-14 14:47:01 +0000 |
commit | 97f9637d2c803b02e32f3cffe953c00457e63088 (patch) | |
tree | 78aba6db360e70fc862ee7d7e601d3a1a0d2ee0b | |
parent | 8e6bf130deeea916e8bf70ebac93768200f966c4 (diff) | |
download | rt.equinox.framework-97f9637d2c803b02e32f3cffe953c00457e63088.tar.gz rt.equinox.framework-97f9637d2c803b02e32f3cffe953c00457e63088.tar.xz rt.equinox.framework-97f9637d2c803b02e32f3cffe953c00457e63088.zip |
Bug 552085 - never fail out of calls to registerAsParallelCapable
Handle the failure case for substrate native images
Change-Id: I933cec84a2e0d6db9d05f551d9bc61556997338d
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
2 files changed, 20 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java index cefca1e0e..0b01cd339 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java @@ -20,8 +20,16 @@ import org.eclipse.osgi.internal.loader.classpath.ClasspathManager; import org.eclipse.osgi.storage.BundleInfo.Generation; public class EquinoxClassLoader extends ModuleClassLoader { - private static final boolean EQUINOX_REGISTERED_AS_PARALLEL = ClassLoader.registerAsParallelCapable(); - + protected static final boolean EQUINOX_REGISTERED_AS_PARALLEL; + static { + boolean registered; + try { + registered = ClassLoader.registerAsParallelCapable(); + } catch (Throwable t) { + registered = false; + } + EQUINOX_REGISTERED_AS_PARALLEL = registered; + } private final EquinoxConfiguration configuration; private final Debug debug; private final BundleLoader delegate; diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java index 601d03297..b51194304 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java @@ -60,7 +60,16 @@ public abstract class ModuleClassLoader extends ClassLoader implements BundleRef * A PermissionCollection for AllPermissions; shared across all ProtectionDomains when security is disabled */ protected static final PermissionCollection ALLPERMISSIONS; - protected static final boolean REGISTERED_AS_PARALLEL = ClassLoader.registerAsParallelCapable(); + protected static final boolean REGISTERED_AS_PARALLEL; + static { + boolean registered; + try { + registered = ClassLoader.registerAsParallelCapable(); + } catch (Throwable t) { + registered = false; + } + REGISTERED_AS_PARALLEL = registered; + } static { AllPermission allPerm = new AllPermission(); |