Skip to content

Commit

Permalink
Fix a couple of tests
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3497 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Aug 14, 2009
1 parent c01f9ef commit 40cec4a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
Expand Up @@ -875,7 +875,7 @@ public Object getReference(Bean<?> bean, CreationalContext<?> creationalContext)
public Object getReference(Bean<?> bean, Type beanType, CreationalContext<?> creationalContext)
{

if (!Beans.isTypePresent(bean, beanType))
if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
{
throw new IllegalArgumentException("The given beanType is not a type " + beanType +" of the bean " + bean );
}
Expand Down
14 changes: 0 additions & 14 deletions impl/src/main/java/org/jboss/webbeans/util/Beans.java
Expand Up @@ -17,7 +17,6 @@
package org.jboss.webbeans.util;

import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
Expand Down Expand Up @@ -336,19 +335,6 @@ public static boolean isBeanEnabled(Bean<?> bean, Collection<Class<?>> enabledPo
return false;
}

public static boolean isTypePresent(Bean<?> bean, Type type)
{
type = Types.boxedType(type);
for (Type beanType : bean.getTypes())
{
if (Types.boxedType(beanType).equals(type))
{
return true;
}
}
return false;
}

/**
* Check if any of the beans is a policy
*
Expand Down

0 comments on commit 40cec4a

Please sign in to comment.