[weld-commits] Weld SVN: r5857 - core/trunk/impl/src/main/java/org/jboss/weld/logging/messages and 2 other directories.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Tue Feb 16 17:38:58 EST 2010


Author: pete.muir at jboss.org
Date: 2010-02-16 17:38:58 -0500 (Tue, 16 Feb 2010)
New Revision: 5857

Modified:
   cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/generic/GenericInitializerMethodTest.java
   core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/UtilMessage.java
   core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
   core/trunk/impl/src/main/resources/org/jboss/weld/messages/util_en.properties
Log:
WELD-425

Modified: cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/generic/GenericInitializerMethodTest.java
===================================================================
--- cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/generic/GenericInitializerMethodTest.java	2010-02-16 22:27:47 UTC (rev 5856)
+++ cdi-tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/initializer/broken/generic/GenericInitializerMethodTest.java	2010-02-16 22:38:58 UTC (rev 5857)
@@ -32,7 +32,6 @@
 {
    @Test(groups = "ri-broken")
    @SpecAssertion(section = "3.9.1", id = "ab")
-   //WELD-425
    public void testGenericInitializerMethodNotAllowed()
    {
       assert false;

Modified: core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/UtilMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/UtilMessage.java	2010-02-16 22:27:47 UTC (rev 5856)
+++ core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/UtilMessage.java	2010-02-16 22:38:58 UTC (rev 5857)
@@ -62,6 +62,7 @@
    @MessageId("000823") ERROR_INVOKING_METHOD,
    @MessageId("000824") ACCESS_ERROR_ON_FIELD,
    @MessageId("000825") NO_SUCH_METHOD,
-   @MessageId("000826") ANNOTATION_VALUES_INACCESSIBLE;
+   @MessageId("000826") ANNOTATION_VALUES_INACCESSIBLE,
+   @MessageId("000827") INITIALIZER_METHOD_IS_GENERIC;
    
 }

Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java	2010-02-16 22:27:47 UTC (rev 5856)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java	2010-02-16 22:38:58 UTC (rev 5857)
@@ -30,6 +30,7 @@
 import static org.jboss.weld.logging.messages.UtilMessage.INITIALIZER_CANNOT_BE_DISPOSAL_METHOD;
 import static org.jboss.weld.logging.messages.UtilMessage.INITIALIZER_CANNOT_BE_OBSERVER;
 import static org.jboss.weld.logging.messages.UtilMessage.INITIALIZER_CANNOT_BE_PRODUCER;
+import static org.jboss.weld.logging.messages.UtilMessage.INITIALIZER_METHOD_IS_GENERIC;
 import static org.jboss.weld.logging.messages.UtilMessage.INVALID_QUANTITY_INJECTABLE_FIELDS_AND_INITIALIZER_METHODS;
 import static org.jboss.weld.logging.messages.UtilMessage.QUALIFIER_ON_FINAL_FIELD;
 import static org.jboss.weld.logging.messages.UtilMessage.REDUNDANT_QUALIFIER;
@@ -407,6 +408,10 @@
                {
                   throw new DefinitionException(INITIALIZER_CANNOT_BE_OBSERVER, method, type);
                }
+               else if (method.getJavaMember().getTypeParameters().length > 0)
+               {
+                  throw new DefinitionException(INITIALIZER_METHOD_IS_GENERIC, method, type);
+               }
                else
                {
                   if (!isOverridden(method, seenMethods))

Modified: core/trunk/impl/src/main/resources/org/jboss/weld/messages/util_en.properties
===================================================================
--- core/trunk/impl/src/main/resources/org/jboss/weld/messages/util_en.properties	2010-02-16 22:27:47 UTC (rev 5856)
+++ core/trunk/impl/src/main/resources/org/jboss/weld/messages/util_en.properties	2010-02-16 22:38:58 UTC (rev 5857)
@@ -25,3 +25,4 @@
 ACCESS_ERROR_ON_FIELD=Error getting field {0} on {1}
 NO_SUCH_METHOD=Method {0} not implemented by instance {1}
 ANNOTATION_VALUES_INACCESSIBLE=Cannot access values() on annotation
+INITIALIZER_METHOD_IS_GENERIC=Initializer method {0} declared on {1} may not be a generic method



More information about the weld-commits mailing list