Clean-up some code only needed for the 4.2 ct which works without the workaround in the 4.3 ct now (FELIX-2950)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1172801 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
index 3f40797..1b3e2e6 100644
--- a/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
+++ b/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
@@ -309,16 +309,8 @@
Object sm = System.getSecurityManager();
if (sm != null)
{
- try
- {
((SecurityManager) sm).checkPermission(
new AdminPermission(bundle, AdminPermission.EXTENSIONLIFECYCLE));
- }
- catch (SecurityException ex)
- {
- // TODO: SECURITY - we need to throw this exception because of the 4.2.0 ct
- throw new AccessControlException(ex.getMessage());
- }
}
if (!((BundleProtectionDomain) bundle.getProtectionDomain()).impliesDirect(new AllPermission()))
@@ -886,4 +878,4 @@
// Nothing needed here.
}
}
-}
\ No newline at end of file
+}
diff --git a/framework/src/main/java/org/apache/felix/framework/Felix.java b/framework/src/main/java/org/apache/felix/framework/Felix.java
index f836663..8dd32a2 100644
--- a/framework/src/main/java/org/apache/felix/framework/Felix.java
+++ b/framework/src/main/java/org/apache/felix/framework/Felix.java
@@ -581,24 +581,7 @@
security = security.trim();
if (Constants.FRAMEWORK_SECURITY_OSGI.equalsIgnoreCase(security) || (security.length() == 0))
{
- // TODO: SECURITY - we only need our own security manager to convert the exceptions
- // because the 4.2.0 ct does expect them like this in one case.
- System.setSecurityManager(m_securityManager = new SecurityManager()
- {
- public void checkPermission(Permission perm)
- {
- try
- {
- super.checkPermission(perm);
- }
- catch (AccessControlException ex)
- {
- SecurityException se = new SecurityException(ex.getMessage());
- se.initCause(ex);
- throw se;
- }
- }
- });
+ System.setSecurityManager(m_securityManager = new SecurityManager());
}
else
{
@@ -5023,4 +5006,4 @@
{
return m_urlHandlersActivator.getContentHandlerService(mimeType);
}
-}
\ No newline at end of file
+}