[weld-commits] Weld SVN: r6334 - in core/trunk/impl/src/main: java/org/jboss/weld/manager and 1 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Thu May 27 15:03:02 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-05-27 15:03:01 -0400 (Thu, 27 May 2010)
New Revision: 6334

Modified:
   core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java
   core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
   core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties
Log:
WELD-497

Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java	2010-05-27 19:02:39 UTC (rev 6333)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/BeanManagerMessage.java	2010-05-27 19:03:01 UTC (rev 6334)
@@ -60,5 +60,9 @@
    @MessageId("001320") INJECTION_ON_NON_CONTEXTUAL,
    @MessageId("001321") MISSING_BEAN_CONSTRUCTOR_FOUND,
    @MessageId("001322") ERROR_INVOKING_POST_CONSTRUCT,
-   @MessageId("001323") ERROR_INVOKING_PRE_DESTROY;
+   @MessageId("001323") ERROR_INVOKING_PRE_DESTROY,
+   @MessageId("001324") NULL_BEAN_ARGUMENT,
+   @MessageId("001324") NULL_BEAN_TYPE_ARGUMENT,
+   @MessageId("001324") NULL_CREATIONAL_CONTEXT_ARGUMENT
+   ;
 }

Modified: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java	2010-05-27 19:02:39 UTC (rev 6333)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java	2010-05-27 19:03:01 UTC (rev 6334)
@@ -23,6 +23,9 @@
 import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_INTERCEPTOR_BINDING_TYPE;
 import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_STEREOTYPE;
 import static org.jboss.weld.logging.messages.BeanManagerMessage.NO_DECORATOR_TYPES;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NULL_BEAN_ARGUMENT;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NULL_BEAN_TYPE_ARGUMENT;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NULL_CREATIONAL_CONTEXT_ARGUMENT;
 import static org.jboss.weld.logging.messages.BeanManagerMessage.SPECIFIED_TYPE_NOT_BEAN_TYPE;
 import static org.jboss.weld.logging.messages.BeanManagerMessage.TOO_MANY_ACTIVITIES;
 import static org.jboss.weld.logging.messages.BeanManagerMessage.UNPROXYABLE_RESOLUTION;
@@ -727,6 +730,18 @@
 
    public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> creationalContext)
    {
+      if (bean == null)
+      {
+         throw new ForbiddenArgumentException(NULL_BEAN_ARGUMENT);
+      }
+      if (beanType == null)
+      {
+         throw new ForbiddenArgumentException(NULL_BEAN_TYPE_ARGUMENT);
+      }
+      if (creationalContext == null)
+      {
+         throw new ForbiddenArgumentException(NULL_CREATIONAL_CONTEXT_ARGUMENT);
+      }
       if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
       {
          throw new ForbiddenArgumentException(SPECIFIED_TYPE_NOT_BEAN_TYPE, beanType, bean );

Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties	2010-05-27 19:02:39 UTC (rev 6333)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/beanmanager_en.properties	2010-05-27 19:03:01 UTC (rev 6334)
@@ -22,3 +22,6 @@
 MISSING_BEAN_CONSTRUCTOR_FOUND=Bean constructor was not found before but appears to be found now
 ERROR_INVOKING_POST_CONSTRUCT=Error invoking post construct method {0}
 ERROR_INVOKING_PRE_DESTROY=Error invoking pre-destroy method {0}
+NULL_BEAN_ARGUMENT=Argument bean must not be null
+NULL_BEAN_TYPE_ARGUMENT=Argument beanType must not be null
+NULL_CREATIONAL_CONTEXT_ARGUMENT=Argument creationalContext must not be null



More information about the weld-commits mailing list