Skip to content

Commit

Permalink
WBTCK-30
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2466 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Apr 17, 2009
1 parent 12aeb90 commit 4cbf69d
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -77,6 +79,7 @@ public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl mana
this.declaringBean = declaringBean;
}

@Override
protected abstract AnnotatedMember<T, S> getAnnotatedItem();

/**
Expand Down Expand Up @@ -166,6 +169,14 @@ public AbstractClassBean<?> getDeclaringBean()
*/
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))
Expand Down

0 comments on commit 4cbf69d

Please sign in to comment.