openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1589764 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
Date Thu, 24 Apr 2014 15:07:05 GMT
Author: arne
Date: Thu Apr 24 15:07:05 2014
New Revision: 1589764

URL: http://svn.apache.org/r1589764
Log:
OWB-946: Fixed Wildcard handling

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java?rev=1589764&r1=1589763&r2=1589764&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
Thu Apr 24 15:07:05 2014
@@ -326,14 +326,34 @@ public final class GenericsUtil
     {
         for (Type bounds: injectionPointType.getLowerBounds())
         {
-            if (!isAssignableFrom(isDelegate, beanType, bounds))
+            Set<Type> beanTypeClosure = getTypeClosure(beanType);
+            boolean isAssignable = false;
+            for (Type beanSupertype: beanTypeClosure)
             {
+                if (isAssignableFrom(isDelegate, beanSupertype, bounds))
+                {
+                    isAssignable = true;
+                    break;
+                }
+            }
+            if (!isAssignable)
+            { 
                 return false;
             }
         }
         for (Type bounds: injectionPointType.getUpperBounds())
         {
-            if (!isAssignableFrom(isDelegate, bounds, beanType))
+            Set<Type> beanTypeClosure = getTypeClosure(beanType);
+            boolean isAssignable = false;
+            for (Type beanSupertype: beanTypeClosure)
+            {
+                if (isAssignableFrom(isDelegate, bounds, beanSupertype))
+                {
+                    isAssignable = true;
+                    break;
+                }
+            }
+            if (!isAssignable)
             {
                 return false;
             }



Mime
View raw message