Skip to content

Commit

Permalink
fix jdk6 compiler errors, imports
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@120 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
sbryzak committed Oct 20, 2008
1 parent 2a80c07 commit d1a1892
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Expand Up @@ -10,12 +10,10 @@

import javax.webbeans.DeploymentType;
import javax.webbeans.Stereotype;
import javax.webbeans.manager.Manager;

import org.jboss.webbeans.BeanImpl;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.introspector.SimpleAnnotatedType;
import org.jboss.webbeans.model.SimpleComponentModel;
import org.jboss.webbeans.model.StereotypeModel;
import org.jboss.webbeans.scannotation.AnnotationDB;
Expand Down
Expand Up @@ -69,7 +69,7 @@ protected void initConstructor()
{
if (getType().getConstructors().length == 1)
{
Constructor<T> constructor = getType().getConstructors()[0];
Constructor<T> constructor = (Constructor<T>) getType().getConstructors()[0];
log.finest("Exactly one constructor (" + constructor +") defined, using it as the component constructor for " + getType());
this.constructor = new SimpleConstructor<T>(constructor);
return;
Expand Down
Expand Up @@ -84,50 +84,53 @@ public static List<Method> getMethods(Class<?> clazz, Class<? extends Annotation
return methods;
}

@SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructors(Class<? extends T> clazz, Class<? extends Annotation> annotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
for (Constructor<T> constructor : clazz.getConstructors())
for (Constructor<?> constructor : clazz.getConstructors())
{
if (constructor.isAnnotationPresent(annotationType))
{
constructors.add(constructor);
constructors.add((Constructor<T>) constructor);
}
}
return constructors;
}

@SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructorsForAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> parameterAnnotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
for (Constructor<T> constructor : clazz.getConstructors())
for (Constructor<?> constructor : clazz.getConstructors())
{
for (Annotation[] annotations : constructor.getParameterAnnotations())
{
for (Annotation annotation : annotations)
{
if (annotation.annotationType().equals(parameterAnnotationType))
{
constructors.add(constructor);
constructors.add((Constructor<T>) constructor);
}
}
}
}
return constructors;
}

@SuppressWarnings("unchecked")
public static <T> List<Constructor<T>> getConstructorsForMetaAnnotatedParameter(Class<? extends T> clazz, Class<? extends Annotation> metaAnnotationType)
{
List<Constructor<T>> constructors = new ArrayList<Constructor<T>>();
for (Constructor<T> constructor : clazz.getConstructors())
for (Constructor<?> constructor : clazz.getConstructors())
{
for (Annotation[] annotations : constructor.getParameterAnnotations())
{
for (Annotation annotation : annotations)
{
if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
{
constructors.add(constructor);
constructors.add((Constructor<T>) constructor);
}
}
}
Expand Down

0 comments on commit d1a1892

Please sign in to comment.