openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1622280 - in /openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/util/GenericsUtil.java test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.java
Date Wed, 03 Sep 2014 15:29:25 GMT
Author: arne
Date: Wed Sep  3 15:29:25 2014
New Revision: 1622280

URL: http://svn.apache.org/r1622280
Log:
OWB-998: Fixed type resolution

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
    openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.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=1622280&r1=1622279&r2=1622280&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
Wed Sep  3 15:29:25 2014
@@ -276,6 +276,7 @@ public final class GenericsUtil
         {
             return false;
         }
+        boolean swapParams = !isDelegate;
         Type[] injectionPointTypeArguments = injectionPointType.getActualTypeArguments();
         Type[] beanTypeArguments = beanType.getActualTypeArguments();
         for (int i = 0; i < injectionPointTypeArguments.length; i++)
@@ -285,20 +286,20 @@ public final class GenericsUtil
 
             // for this special case it's actually an 'assignable to', thus we swap the params,
see CDI-389
             // but this special rule does not apply to Delegate injection points...
-            if (!isDelegate &&
+            if (swapParams &&
                 (injectionPointTypeArgument instanceof Class || injectionPointTypeArgument
instanceof TypeVariable) &&
                 beanTypeArgument instanceof TypeVariable)
             {
                 for (Type upperBound: ((TypeVariable<?>)beanTypeArgument).getBounds())
                 {
-                    if (!isAssignableFrom(isDelegate, upperBound, injectionPointTypeArgument))
+                    if (!isAssignableFrom(swapParams, upperBound, injectionPointTypeArgument))
                     {
                         return false;
                     }
                 }
 
             }
-            else if (!isDelegate && injectionPointTypeArgument instanceof TypeVariable)
+            else if (swapParams && injectionPointTypeArgument instanceof TypeVariable)
             {
                 return false;
             }

Modified: openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.java?rev=1622280&r1=1622279&r2=1622280&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/injection/generics/ArrayOuttOfBouncExceptionFromMLTest.java
Wed Sep  3 15:29:25 2014
@@ -19,7 +19,6 @@
 package org.apache.webbeans.test.injection.generics;
 
 import org.apache.webbeans.test.AbstractUnitTest;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import javax.inject.Inject;
@@ -31,7 +30,6 @@ import java.util.HashMap;
 import static org.junit.Assert.assertNotNull;
 
 // http://openejb.979440.n4.nabble.com/ArrayIndexOutOfBoundsException-on-TomEE-1-6-0-td4665080.html
-@Ignore("OWB-998")
 public class ArrayOuttOfBouncExceptionFromMLTest extends AbstractUnitTest
 {
     @Inject



Mime
View raw message