Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@1203 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Jan 23, 2009
1 parent ffcbc0f commit d76a003
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 23 deletions.
Expand Up @@ -18,7 +18,6 @@
package org.jboss.webbeans.bean;

import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.HashSet;
Expand Down Expand Up @@ -383,28 +382,6 @@ public Set<Annotation> getBindings()
return bindingTypes;
}

/**
* Gets the declared bean type
*
* @return The bean type
*/
protected Type getDeclaredBeanType()
{
if (declaredBeanType == null)
{
Type type = getClass();
if (type instanceof ParameterizedType)
{
ParameterizedType parameterizedType = (ParameterizedType) type;
if (parameterizedType.getActualTypeArguments().length == 1)
{
declaredBeanType = parameterizedType.getActualTypeArguments()[0];
}
}
}
return declaredBeanType;
}

/**
* Gets the default name of the bean
*
Expand Down
Expand Up @@ -19,6 +19,7 @@

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.HashSet;
import java.util.Set;
Expand Down Expand Up @@ -120,6 +121,25 @@ protected void initType()
throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
}
}

/**
* Gets the declared bean type
*
* @return The bean type
*/
protected Type getDeclaredBeanType()
{
Type type = getClass();
if (type instanceof ParameterizedType)
{
ParameterizedType parameterizedType = (ParameterizedType) type;
if (parameterizedType.getActualTypeArguments().length == 1)
{
return parameterizedType.getActualTypeArguments()[0];
}
}
return null;
}

/**
* Returns the declaring bean
Expand Down

0 comments on commit d76a003

Please sign in to comment.