Author: dblevins
Date: Sun Jun 26 06:04:26 2011
New Revision: 1139718

URL: http://svn.apache.org/viewvc?rev=1139718&view=rev
Log:
Fill up with nullpointer checks in hopes to easily flush out MDB regressions

Modified:
    
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ConstructorInjectionBean.java

Modified: 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ConstructorInjectionBean.java
URL: 
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ConstructorInjectionBean.java?rev=1139718&r1=1139717&r2=1139718&view=diff
==============================================================================
--- 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ConstructorInjectionBean.java
 (original)
+++ 
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/ConstructorInjectionBean.java
 Sun Jun 26 06:04:26 2011
@@ -21,6 +21,7 @@ import org.apache.webbeans.component.Web
 import org.apache.webbeans.config.DefinitionUtil;
 import org.apache.webbeans.config.WebBeansContext;
 import org.apache.webbeans.inject.InjectableConstructor;
+import org.apache.webbeans.util.WebBeansUtil;
 
 import javax.enterprise.context.spi.CreationalContext;
 import java.lang.reflect.Constructor;
@@ -35,10 +36,21 @@ public class ConstructorInjectionBean<T>
     public ConstructorInjectionBean(WebBeansContext webBeansContext, Class<T> 
returnType) {
         super(WebBeansType.DEPENDENT, returnType, webBeansContext);
 
-        constructor = 
webBeansContext.getWebBeansUtil().defineConstructor(getReturnType());
+        if (webBeansContext == null) throw new 
NullPointerException("webBeansContext");
+        if (returnType == null) throw new NullPointerException("returnType");
+
+        final WebBeansUtil webBeansUtil = webBeansContext.getWebBeansUtil();
+
+        if (webBeansUtil == null) throw new 
NullPointerException("webBeansUtil");
+
+        constructor = webBeansUtil.defineConstructor(returnType);
+
+        if (constructor == null) throw new NullPointerException("constructor");
 
         final DefinitionUtil definitionUtil = 
getWebBeansContext().getDefinitionUtil();
 
+        if (definitionUtil == null) throw new 
NullPointerException("definitionUtil");
+
         definitionUtil.addConstructorInjectionPointMetaData(this, constructor);
 
         // these are not used immediately in createInstance()


Reply via email to