[jboss-cvs] JBossAS SVN: r64429 - projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 2 10:16:00 EDT 2007


Author: adrian at jboss.org
Date: 2007-08-02 10:16:00 -0400 (Thu, 02 Aug 2007)
New Revision: 64429

Modified:
   projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java
Log:
Apply Alexey's patch

Modified: projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java	2007-08-02 14:02:06 UTC (rev 64428)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/reflect/plugins/introspection/IntrospectionTypeInfoFactoryImpl.java	2007-08-02 14:16:00 UTC (rev 64429)
@@ -560,6 +560,7 @@
       return getTypeInfo(result);
    }
 
+   @SuppressWarnings("unchecked")
    protected static Type locateActualType(Class reference, int parameter, Class clazz, Type type)
    {
       if (reference.equals(clazz))
@@ -579,24 +580,26 @@
       Type[] interfaces = clazz.getGenericInterfaces();
       for (Type intf : interfaces)
       {
-         Type result;
+         Class interfaceClass;
          if (intf instanceof Class)
          {
-            Class interfaceClass = (Class) intf;
-            result = locateActualType(reference, parameter, interfaceClass, intf);
-            if (result instanceof TypeVariable)
-               result = getParameter(clazz, type, (TypeVariable) result);
+            interfaceClass = (Class) intf;
          }
          else if (intf instanceof ParameterizedType)
          {
             ParameterizedType interfaceType = (ParameterizedType) intf;
-            Class interfaceClass = (Class) interfaceType.getRawType();
+            interfaceClass = (Class) interfaceType.getRawType();
+         }
+         else
+            throw new IllegalStateException("Unexpected type " + intf.getClass());
+
+         Type result = null;
+         if (reference.isAssignableFrom(interfaceClass))
+         {
             result = locateActualType(reference, parameter, interfaceClass, intf);
             if (result instanceof TypeVariable)
                result = getParameter(clazz, type, (TypeVariable) result);
          }
-         else
-            throw new IllegalStateException("Unexpected type " + intf.getClass());
          if (result != null)
             return result;
       }




More information about the jboss-cvs-commits mailing list