openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1411090 - /openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Date Mon, 19 Nov 2012 07:32:41 GMT
Author: rmannibucau
Date: Mon Nov 19 07:32:40 2012
New Revision: 1411090

URL: http://svn.apache.org/viewvc?rev=1411090&view=rev
Log:
OWB-722 @Typed not respected for bean with generics

Modified:
    openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java

Modified: openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java?rev=1411090&r1=1411089&r2=1411090&view=diff
==============================================================================
--- openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
(original)
+++ openwebbeans/branches/owb_1.1.x/webbeans-impl/src/main/java/org/apache/webbeans/util/ClassUtil.java
Mon Nov 19 07:32:40 2012
@@ -222,6 +222,16 @@ public final class ClassUtil
         return clazz.isMemberClass();
     }
 
+    public static Class<?>  identityOrGetPrimitiveWrapper(Class<?> clazz)
+    {
+        if (clazz.isPrimitive())
+        {
+            return getPrimitiveWrapper(clazz);
+        }
+        return clazz;
+
+    }
+
     public static Class<?>  getPrimitiveWrapper(Class<?> clazz)
     {
         Asserts.nullCheckForClass(clazz);
@@ -565,9 +575,9 @@ public final class ClassUtil
         {
             boolean ok = true;
             ParameterizedType ptBean = (ParameterizedType)beanType;
-            Class<?> clazzBeanType = (Class<?>)ptBean.getRawType();
-            Class<?> clazzReqType = (Class<?>)requiredType;
-            if(isClassAssignable(clazzReqType, clazzBeanType ))
+            Class<?> clazzBeanType = identityOrGetPrimitiveWrapper((Class<?>)ptBean.getRawType());
+            Class<?> clazzReqType = identityOrGetPrimitiveWrapper((Class<?>)requiredType);
+            if(clazzBeanType.equals(clazzReqType))
             {
                 Type[]  beanTypeArgs = ptBean.getActualTypeArguments();               
                 for(Type actual : beanTypeArgs)



Mime
View raw message