felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r771010 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
Date Sun, 03 May 2009 01:17:34 GMT
Author: rickhall
Date: Sun May  3 01:17:33 2009
New Revision: 771010

URL: http://svn.apache.org/viewvc?rev=771010&view=rev
Log:
NPE if installed JAR is not a bundle; check for it now. (FELIX-29)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java?rev=771010&r1=771009&r2=771010&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/FelixResolverState.java
Sun May  3 01:17:33 2009
@@ -70,16 +70,23 @@
             if (!host.isResolved() && !Util.isFragment(host))
             {
                 ICapability[] caps = host.getCapabilities();
-                ICapability bundleCap = null;
+                ICapability hostCap = null;
                 for (int capIdx = 0; capIdx < caps.length; capIdx++)
                 {
                     if (caps[capIdx].getNamespace().equals(ICapability.HOST_NAMESPACE))
                     {
-                        bundleCap = caps[capIdx];
+                        hostCap = caps[capIdx];
                         break;
                     }
                 }
 
+                // If there is no host capability in the current module,
+                // then just ignore it.
+                if (hostCap == null)
+                {
+                    continue;
+                }
+
                 // Need to remove any previously attached, but not resolved fragments.
                 // TODO: FRAGMENT - Would be better to have the previous resolves
                 //       not leave fragments attached.
@@ -99,7 +106,7 @@
                         for (int reqIdx = 0; reqIdx < reqs.length; reqIdx++)
                         {
                             if (reqs[reqIdx].getNamespace().equals(ICapability.HOST_NAMESPACE)
-                                && reqs[reqIdx].isSatisfied(bundleCap)
+                                && reqs[reqIdx].isSatisfied(hostCap)
                                 && !((BundleImpl) fragments[fragIdx].getBundle()).isStale()
                                 && !((BundleImpl) fragments[fragIdx].getBundle()).isRemovalPending())
                             {



Mime
View raw message