camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [3/4] camel git commit: Fixed potential NPE
Date Tue, 31 May 2016 07:16:53 GMT
Fixed potential NPE


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

Branch: refs/heads/camel-2.17.x
Commit: d0186a417588abfcd8f1707b2befd62e00dbf715
Parents: 1e179aa
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue May 31 08:07:30 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue May 31 09:16:19 2016 +0200

----------------------------------------------------------------------
 .../apache/camel/component/bean/ConstantBeanHolder.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/d0186a41/camel-core/src/main/java/org/apache/camel/component/bean/ConstantBeanHolder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/ConstantBeanHolder.java
b/camel-core/src/main/java/org/apache/camel/component/bean/ConstantBeanHolder.java
index d2cbe1c..1965d2b 100644
--- a/camel-core/src/main/java/org/apache/camel/component/bean/ConstantBeanHolder.java
+++ b/camel-core/src/main/java/org/apache/camel/component/bean/ConstantBeanHolder.java
@@ -40,11 +40,17 @@ public class ConstantBeanHolder implements BeanHolder {
     }
 
     public ConstantBeanHolder(Object bean, CamelContext context) {
-        this(bean, new BeanInfo(context, bean.getClass()));
+        ObjectHelper.notNull(bean, "bean");
+
+        this.bean = bean;
+        this.beanInfo = new BeanInfo(context, bean.getClass());
     }
 
     public ConstantBeanHolder(Object bean, CamelContext context, ParameterMappingStrategy
parameterMappingStrategy) {
-        this(bean, new BeanInfo(context, bean.getClass(), parameterMappingStrategy));
+        ObjectHelper.notNull(bean, "bean");
+
+        this.bean = bean;
+        this.beanInfo = new BeanInfo(context, bean.getClass(), parameterMappingStrategy);
     }
 
     @Override


Mime
View raw message