[webbeans-commits] Webbeans SVN: r3260 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable and 1 other directory.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Sun Jul 26 16:02:03 EDT 2009


Author: pete.muir at jboss.org
Date: 2009-07-26 16:02:03 -0400 (Sun, 26 Jul 2009)
New Revision: 3260

Modified:
   ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java
   tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java
Log:
Fix RI and test

Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-07-26 19:50:22 UTC (rev 3259)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java	2009-07-26 20:02:03 UTC (rev 3260)
@@ -18,6 +18,7 @@
 
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
@@ -305,6 +306,10 @@
          {
             throw new DefinitionException("Cannot inject an InjectionPoint into a non @Dependent scoped bean " + injectionPoint); 
          }
+         if (injectionPoint.getType() instanceof TypeVariable<?>)
+         {
+            throw new DefinitionException("Cannot declare an injection point with a type variable " + injectionPoint);
+         }
       }
       return true;
    }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java	2009-07-26 19:50:22 UTC (rev 3259)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/Farm.java	2009-07-26 20:02:03 UTC (rev 3260)
@@ -1,9 +1,13 @@
 package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
 
-import javax.enterprise.inject.Current;
+import javax.enterprise.inject.Initializer;
 
 @SuppressWarnings("unused")
-class Farm<T extends Animal>
+class Farm
 {
-   @Current private T animal;
+   @Initializer
+   public <T extends Animal> void setAnimal(T animal)
+   {
+      
+   }
 }

Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java	2009-07-26 19:50:22 UTC (rev 3259)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/broken/type/variable/TypeVariableInjectionPointTest.java	2009-07-26 20:02:03 UTC (rev 3260)
@@ -17,6 +17,7 @@
 package org.jboss.jsr299.tck.tests.lookup.typesafe.resolution.broken.type.variable;
 
 import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
 import org.jboss.jsr299.tck.DefinitionError;
 import org.jboss.testharness.impl.packaging.Artifact;
 import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
@@ -29,11 +30,12 @@
  */
 @Artifact
 @ExpectedDeploymentException(DefinitionError.class)
-public class TypeVariableInjectionPointTest
+public class TypeVariableInjectionPointTest extends AbstractJSR299Test
 {
-   @Test(groups={"resolution", "ri-broken"})
-   @SpecAssertion(section="5.3.2", id="c")
-   public void testTypeVariableInjectionPoint() {
+   @Test(groups = { "resolution"})
+   @SpecAssertion(section = "5.3.2", id = "c")
+   public void testTypeVariableInjectionPoint()
+   {
       assert false;
    }
 }




More information about the weld-commits mailing list