[webbeans-commits] Webbeans SVN: r2466 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method and 1 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Fri Apr 17 08:49:27 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-04-17 08:49:27 -0400 (Fri, 17 Apr 2009)
New Revision: 2466
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/TProducer.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
Log:
WBTCK-30
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-04-17 12:23:16 UTC (rev 2465)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-04-17 12:49:27 UTC (rev 2466)
@@ -24,6 +24,8 @@
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
import java.util.HashSet;
import java.util.Set;
@@ -77,6 +79,7 @@
this.declaringBean = declaringBean;
}
+ @Override
protected abstract AnnotatedMember<T, S> getAnnotatedItem();
/**
@@ -166,6 +169,14 @@
*/
protected void checkProducerReturnType()
{
+ if (getAnnotatedItem().getType() instanceof TypeVariable<?>)
+ {
+ throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getType());
+ }
+ if (getAnnotatedItem().getType() instanceof WildcardType)
+ {
+ throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getType());
+ }
for (Type type : getAnnotatedItem().getActualTypeArguments())
{
if (!(type instanceof Class))
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java 2009-04-17 12:49:27 UTC (rev 2466)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.parametermizedTypeWithTypeParameter2;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at ExpectedDeploymentException(DefinitionException.class)
+public class ParameterizedTypeWithTypeParameterTest extends AbstractJSR299Test
+{
+
+ @Test
+ @SpecAssertion(section = "3.4", id = "i")
+ public void testParameterizedType()
+ {
+ assert false;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/ParameterizedTypeWithTypeParameterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/TProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/TProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/TProducer.java 2009-04-17 12:49:27 UTC (rev 2466)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.parametermizedTypeWithTypeParameter2;
+
+import javax.inject.Produces;
+import javax.inject.manager.InjectionPoint;
+
+public class TProducer
+{
+ @Produces
+ public <T> T create(InjectionPoint point)
+ {
+ return null;
+ }
+}
+
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/parametermizedTypeWithTypeParameter2/TProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the weld-commits
mailing list