Author: pete.muir(a)jboss.org
Date: 2009-03-25 20:42:15 -0400 (Wed, 25 Mar 2009)
New Revision: 2206
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java
Log:
WBRI-169
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-25 20:42:35
UTC (rev 2205)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-26 00:42:15
UTC (rev 2206)
@@ -18,6 +18,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
@@ -86,6 +87,21 @@
{
throw new DefinitionException("The injection point " +
injectionPoint + " is annotated with @New which cannot be combined with other binding
types");
}
+ if (injectionPoint.getType() instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType)
injectionPoint.getType();
+ for (Type type : parameterizedType.getActualTypeArguments())
+ {
+ if (type instanceof TypeVariable)
+ {
+ throw new DefinitionException("Injection point cannot have a
type variable type parameter " + injectionPoint);
+ }
+ if (type instanceof WildcardType)
+ {
+ throw new DefinitionException("Injection point cannot have a
wildcard type parameter " + injectionPoint);
+ }
+ }
+ }
checkFacadeInjectionPoint(injectionPoint, Obtains.class, Instance.class);
checkFacadeInjectionPoint(injectionPoint, Fires.class, Event.class);
Annotation[] bindings = injectionPoint.getBindings().toArray(new
Annotation[0]);
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java 2009-03-25
20:42:35 UTC (rev 2205)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/BeanWithInjectedField_Broken.java 2009-03-26
00:42:15 UTC (rev 2206)
@@ -1,9 +1,13 @@
package org.jboss.jsr299.tck.tests.definition.deployment.broken.typevariable;
-import javax.inject.Current;
+import javax.inject.Initializer;
class BeanWithInjectedField_Broken
{
- @Current
- private Farmer_Broken injectedFarmer;
+
+ @Initializer
+ public <T> void initialize(Farmer_Broken<T> farmer)
+ {
+
+ }
}
\ No newline at end of file
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java 2009-03-25
20:42:35 UTC (rev 2205)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/typevariable/ParameterizedTypeInjectionTest.java 2009-03-26
00:42:15 UTC (rev 2206)
@@ -16,7 +16,7 @@
@ExpectedDeploymentException(DefinitionException.class)
public class ParameterizedTypeInjectionTest extends AbstractJSR299Test
{
- @Test(groups = {"ri-broken"})
+ @Test
@SpecAssertion(section = "2.2", id = "c")
public void testInjectionPointIsNotParameterizedTypeWithTypeVariable()
{
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java
===================================================================
---
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java 2009-03-25
20:42:35 UTC (rev 2205)
+++
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/broken/wildcard/WildcardTypeInjectionTest.java 2009-03-26
00:42:15 UTC (rev 2206)
@@ -16,7 +16,7 @@
@ExpectedDeploymentException(DefinitionException.class)
public class WildcardTypeInjectionTest extends AbstractJSR299Test
{
- @Test(groups = {"ri-broken"})
+ @Test
@SpecAssertion(section = "2.2", id = "d")
public void testInjectionPointIsNotParameterizedTypeWithWildcardVariable()
{