felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r785596 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
Date Wed, 17 Jun 2009 13:38:01 GMT
Author: rickhall
Date: Wed Jun 17 13:38:01 2009
New Revision: 785596

URL: http://svn.apache.org/viewvc?rev=785596&view=rev
Log:
Array index out of bounds exception occurred when creating protection
domain since it was doing a BundleImpl.toString() before adding the
module to the bundle. (FELIX-1170)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=785596&r1=785595&r2=785596&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java Wed Jun
17 13:38:01 2009
@@ -971,13 +971,16 @@
             // TODO: Security
             // sp.checkBundle(this);
         }
-        module.setSecurityContext(new BundleProtectionDomain(getFramework(), this));
 
         IModule[] dest = new IModule[m_modules.length + 1];
         System.arraycopy(m_modules, 0, dest, 0, m_modules.length);
         dest[m_modules.length] = module;
         m_modules = dest;
 
+        // Set protection domain after adding the module to the bundle,
+        // since this requires that the bundle has a module.
+        module.setSecurityContext(new BundleProtectionDomain(getFramework(), this));
+
         // TODO: REFACTOR - consider moving ModuleImpl into the framework package
         // so we can null module capabilities for extension bundles so we don't
         // need this check anymore.



Mime
View raw message