aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1614343 - /aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
Date Tue, 29 Jul 2014 13:28:14 GMT
Author: mnuttall
Date: Tue Jul 29 13:28:14 2014
New Revision: 1614343

URL: http://svn.apache.org/r1614343
Log:
Aries-1225: NPE thrown by GetBundleContextAction

Modified:
    aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java

Modified: aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java?rev=1614343&r1=1614342&r2=1614343&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
(original)
+++ aries/trunk/subsystem/subsystem-core/src/main/java/org/apache/aries/subsystem/core/internal/GetBundleContextAction.java
Tue Jul 29 13:28:14 2014
@@ -16,6 +16,8 @@ package org.apache.aries.subsystem.core.
 import java.security.PrivilegedAction;
 import java.util.EnumSet;
 
+import org.eclipse.equinox.region.Region;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.service.subsystem.Subsystem.State;
 
@@ -32,9 +34,9 @@ public class GetBundleContextAction impl
 				subsystem.getState()))
 			return null;
 		BasicSubsystem subsystem = Utils.findScopedSubsystemInRegion(this.subsystem);
-		return subsystem.getRegion().getBundle(
-				RegionContextBundleHelper.SYMBOLICNAME_PREFIX
-						+ subsystem.getSubsystemId(),
-				RegionContextBundleHelper.VERSION).getBundleContext();
+		Region region = subsystem.getRegion();
+		String bundleName = RegionContextBundleHelper.SYMBOLICNAME_PREFIX + subsystem.getSubsystemId();
+		Bundle bundle = region.getBundle(bundleName, RegionContextBundleHelper.VERSION);
+		return bundle.getBundleContext();
 	}
 }



Mime
View raw message