[webbeans-commits] Webbeans SVN: r120 - in ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans: model and 1 other directories.

webbeans-commits at lists.jboss.org webbeans-commits at lists.jboss.org
Mon Oct 20 02:50:04 EDT 2008


Author: shane.bryzak at jboss.com
Date: 2008-10-20 02:50:03 -0400 (Mon, 20 Oct 2008)
New Revision: 120

Modified:
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
   ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
Log:
fix jdk6 compiler errors, imports

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java	2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/deployment/DeploymentStrategy.java	2008-10-20 06:50:03 UTC (rev 120)
@@ -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;

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java	2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/SimpleComponentModel.java	2008-10-20 06:50:03 UTC (rev 120)
@@ -69,7 +69,7 @@
    {
       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;

Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	2008-10-19 22:31:44 UTC (rev 119)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/util/Reflections.java	2008-10-20 06:50:03 UTC (rev 120)
@@ -84,23 +84,25 @@
       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())
          {
@@ -108,7 +110,7 @@
             {
                if (annotation.annotationType().equals(parameterAnnotationType))
                {
-                  constructors.add(constructor);
+                  constructors.add((Constructor<T>) constructor);
                }
             }
          }
@@ -116,10 +118,11 @@
       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())
          {
@@ -127,7 +130,7 @@
             {
                if (annotation.annotationType().isAnnotationPresent(metaAnnotationType))
                {
-                  constructors.add(constructor);
+                  constructors.add((Constructor<T>) constructor);
                }
             }
          }




More information about the weld-commits mailing list