openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1607310 - in /openwebbeans/trunk: webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java webbeans-tck/testng-dev.xml
Date Wed, 02 Jul 2014 11:10:51 GMT
Author: rmannibucau
Date: Wed Jul  2 11:10:51 2014
New Revision: 1607310

URL: http://svn.apache.org/r1607310
Log:
avoiding NPE + few more generics

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/GenericsUtil.java
    openwebbeans/trunk/webbeans-tck/testng-dev.xml

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=1607310&r1=1607309&r2=1607310&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Wed Jul  2 11:10:51 2014
@@ -1247,7 +1247,7 @@ public class BeanManagerImpl implements 
         final Collection<AnnotatedType<T>> types = new ArrayList<AnnotatedType<T>>(2);
         types.add(annotatedElementFactory.getAnnotatedType(type));
         final ConcurrentMap<String, AnnotatedType<?>> aTypes = additionalAnnotatedTypes.get(type);
-        if (types != null)
+        if (aTypes != null)
         {
             for (final AnnotatedType at : aTypes.values())
             {

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=1607310&r1=1607309&r2=1607310&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 Jul  2 11:10:51 2014
@@ -338,6 +338,11 @@ public final class GenericsUtil
     {
         for (Type bounds: injectionPointType.getLowerBounds())
         {
+            if (!isAssignableFrom(isDelegate, beanType, bounds))
+            {
+                return false;
+            }
+            /*
             Set<Type> beanTypeClosure = getTypeClosure(beanType);
             boolean isAssignable = false;
             for (Type beanSupertype: beanTypeClosure)
@@ -352,6 +357,7 @@ public final class GenericsUtil
             { 
                 return false;
             }
+            */
         }
         for (Type bounds: injectionPointType.getUpperBounds())
         {
@@ -359,7 +365,10 @@ public final class GenericsUtil
             boolean isAssignable = false;
             for (Type beanSupertype: beanTypeClosure)
             {
-                if (isAssignableFrom(isDelegate, bounds, beanSupertype))
+                if (isAssignableFrom(isDelegate, bounds, beanSupertype)
+                    || (Class.class.isInstance(bounds)
+                        && ParameterizedType.class.isInstance(beanSupertype)
+                        && bounds == ParameterizedType.class.cast(beanSupertype).getRawType()))
                 {
                     isAssignable = true;
                     break;

Modified: openwebbeans/trunk/webbeans-tck/testng-dev.xml
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-tck/testng-dev.xml?rev=1607310&r1=1607309&r2=1607310&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-tck/testng-dev.xml (original)
+++ openwebbeans/trunk/webbeans-tck/testng-dev.xml Wed Jul  2 11:10:51 2014
@@ -18,7 +18,7 @@
 <suite name="JSR-346-TCK" verbose="2" configfailurepolicy="continue">
   <test name="JSR-346 TCK">
     <classes>
-      <class name="org.jboss.cdi.tck.tests.event.observer.wildcardAndTypeVariable.ObserverMethodWithParametertizedTypeTest"
/>
+      <class name="org.jboss.cdi.tck.tests.event.resolve.typeWithParameters.CheckTypeParametersWhenResolvingObserversTest"
/>
       <!--
       <class name="org.jboss.cdi.tck.tests.event.parameterized.ParameterizedEventTest"
/>
       <class name="org.jboss.cdi.tck.tests.event.fires.FireEventTest" />



Mime
View raw message