diff options
author | Thomas Watson | 2012-08-09 14:42:47 +0000 |
---|---|---|
committer | Thomas Watson | 2012-08-09 14:42:47 +0000 |
commit | f5a10914b47f66407243d41b2eb389e4c9325c81 (patch) | |
tree | 91e326d252210964a096c4f7060b47231b163bdb /bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java | |
parent | f372d4040ffd82c785b3190d7b867ff54b9ca35b (diff) | |
download | rt.equinox.framework-f5a10914b47f66407243d41b2eb389e4c9325c81.tar.gz rt.equinox.framework-f5a10914b47f66407243d41b2eb389e4c9325c81.tar.xz rt.equinox.framework-f5a10914b47f66407243d41b2eb389e4c9325c81.zip |
Must fail to start framework if security manager is set and we were configured to set the security manager.
Diffstat (limited to 'bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java')
-rw-r--r-- | bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java index 2a79dfcca..0ae93fdac 100644 --- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java +++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/SystemBundleActivator.java @@ -97,10 +97,14 @@ public class SystemBundleActivator implements BundleActivator { startHookActivators(bundle.getEquinoxContainer(), bc); } - private void installSecurityManager(EquinoxConfiguration configuration) { - String securityManager = configuration.getConfiguration(Constants.FRAMEWORK_SECURITY, configuration.getConfiguration(EquinoxConfiguration.PROP_EQUINOX_SECURITY)); + private void installSecurityManager(EquinoxConfiguration configuration) throws BundleException { + String securityManager = configuration.getConfiguration(Constants.FRAMEWORK_SECURITY); + if (System.getSecurityManager() != null && securityManager != null) { + throw new BundleException("Cannot specify the \"" + Constants.FRAMEWORK_SECURITY + "\" configuration property when a security manager is already installed."); //$NON-NLS-1$ //$NON-NLS-2$ + } + if (securityManager == null) { - securityManager = configuration.getProperty("java.security.manager"); //$NON-NLS-1$ + securityManager = configuration.getConfiguration(EquinoxConfiguration.PROP_EQUINOX_SECURITY, configuration.getProperty("java.security.manager")); //$NON-NLS-1$ } if (securityManager != null) { SecurityManager sm = System.getSecurityManager(); |