camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: Avoid potential NPE such as when using camel-test-blueprint
Date Sat, 03 Oct 2015 07:47:17 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x 32b1b8263 -> 220f7089f


Avoid potential NPE such as when using camel-test-blueprint


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/22bff3d7
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/22bff3d7
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/22bff3d7

Branch: refs/heads/camel-2.15.x
Commit: 22bff3d7b9edd33462b9b17841d97c9dd5c89549
Parents: 32b1b82
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Oct 3 09:30:28 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Oct 3 09:49:06 2015 +0200

----------------------------------------------------------------------
 .../main/java/org/apache/camel/impl/osgi/Activator.java | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/22bff3d7/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
index 5c23351..5e37ac4 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java
@@ -216,11 +216,13 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer
{
             return true;
         }
         BundleCapability packageCap = packageCapabilities.get(clazz.getPackage().getName());
-        BundleWiring wiring = bundle.adapt(BundleWiring.class);
-        List<BundleWire> imports = wiring.getRequiredWires(PACKAGE_NAMESPACE);
-        for (BundleWire importWire : imports) {
-            if (packageCap.equals(importWire.getCapability())) {
-                return true;
+        if (packageCap != null) {
+            BundleWiring wiring = bundle.adapt(BundleWiring.class);
+            List<BundleWire> imports = wiring.getRequiredWires(PACKAGE_NAMESPACE);
+            for (BundleWire importWire : imports) {
+                if (packageCap.equals(importWire.getCapability())) {
+                    return true;
+                }
             }
         }
         return false;


Mime
View raw message