Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/EquinoxClassLoader.java12
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/loader/ModuleClassLoader.java11
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();

Back to the top