openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r927148 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
Date Wed, 24 Mar 2010 18:48:01 GMT
Author: struberg
Date: Wed Mar 24 18:48:00 2010
New Revision: 927148

URL: http://svn.apache.org/viewvc?rev=927148&view=rev
Log:
OWB-329 only add dependent CreationalContext for @Dpendent beans

This needs to be reverted, otherwise I got all @ApplicationScoped beans directly
into the CreationalContext of another @NormalScopedBeans, which lead to 
SerializationExceptions

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=927148&r1=927147&r2=927148&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 Mar 24 18:48:00 2010
@@ -714,9 +714,11 @@ public class BeanManagerImpl implements 
         Bean<Object> injectedBean = (Bean<Object>)injectionResolver.getInjectionPointBean(injectionPoint);
         CreationalContextImpl<Object> injectedCreational = (CreationalContextImpl<Object>)createCreationalContext(injectedBean);
         
-        injectedCreational.setOwnerCreational(ownerCreationalContextImpl);
         if(WebBeansUtil.isDependent(injectedBean))
         {        
+            // this must only be added for dependent beans, otherwise we register @NormalScoped
beans as dependent!
+            injectedCreational.setOwnerCreational(ownerCreationalContextImpl);
+            
             //Creating a new creational context for target bean instance
             instance = getReference(injectedBean, injectionPoint.getType(), injectedCreational);
             
@@ -836,7 +838,7 @@ public class BeanManagerImpl implements 
             }
             
             //Get dependent from DependentContex that create contextual instance
-            instance = context.get((Bean<Object>)bean, (CreationalContext<Object>)creationalContext);
    
+            instance = context.get((Bean<Object>)bean, (CreationalContext<Object>)creationalContext);
         }
         
         return instance;



Mime
View raw message