openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1613390 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Date Fri, 25 Jul 2014 11:23:37 GMT
Author: struberg
Date: Fri Jul 25 11:23:36 2014
New Revision: 1613390

URL: http://svn.apache.org/r1613390
Log:
OWB-987 improve getReference type handling

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java

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=1613390&r1=1613389&r2=1613390&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
Fri Jul 25 11:23:36 2014
@@ -673,7 +673,7 @@ public class BeanManagerImpl implements 
 
 
         //Check type if bean type is given
-        if(beanType != null)
+        if(beanType != null && beanType != Object.class)
         {
             if(!isBeanTypeAssignableToGivenType(bean.getTypes(), beanType, bean instanceof
NewBean) &&
                !GenericsUtil.satisfiesDependency(false, beanType, bean.getBeanClass()))
@@ -682,8 +682,13 @@ public class BeanManagerImpl implements 
             }
             
         }
-        else
+        else if (bean instanceof OwbBean)
         {
+            // we cannot always use getBeanClass() as this will
+            // return the containing class for producer methods and fields
+            beanType = ((OwbBean) bean).getReturnType();
+        }
+        else {
             beanType = bean.getBeanClass();
         }
 
@@ -702,7 +707,6 @@ public class BeanManagerImpl implements 
             if (instance == null)
             {
                 //Create Managed Bean Proxy
-                //X old approach: instance = webBeansContext.getProxyFactoryRemove().createNormalScopedBeanProxyRemove((AbstractOwbBean<?>)
bean, creationalContext);
                 instance = webBeansContext.getNormalScopeProxyFactory().createNormalScopeProxy(bean);
 
                 //Cached instance



Mime
View raw message