openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r932162 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
Date Thu, 08 Apr 2010 22:54:38 GMT
Author: struberg
Date: Thu Apr  8 22:54:38 2010
New Revision: 932162

URL: http://svn.apache.org/viewvc?rev=932162&view=rev
Log:
OWB-329 only use given CreationalContext if no previously stored one can be found

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java?rev=932162&r1=932161&r2=932162&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/NormalScopedBeanInterceptorHandler.java
Thu Apr  8 22:54:38 2010
@@ -103,18 +103,19 @@ public class NormalScopedBeanInterceptor
             return webbeansInstance;
         }
         
-        if (creationalContext == null)
+        if (webbeansContext instanceof AbstractContext)
         {
-            if (webbeansContext instanceof AbstractContext)
-            {
-                creationalContext = ((AbstractContext)webbeansContext).getCreationalContext(bean);
-            }
-            if (creationalContext == null)
+            CreationalContext<?> cc = ((AbstractContext)webbeansContext).getCreationalContext(bean);
+            if (cc != null)
             {
-                // if there was no CreationalContext set from external, we create a new one
-                creationalContext = CreationalContextFactory.getInstance().getCreationalContext(bean);
+                creationalContext = cc;
             }
         }
+        if (creationalContext == null)
+        {
+            // if there was no CreationalContext set from external, we create a new one
+            creationalContext = CreationalContextFactory.getInstance().getCreationalContext(bean);
+        }
         
         // finally, we create a new contextual instance
         webbeansInstance = webbeansContext.get((Contextual<Object>)this.bean, (CreationalContext<Object>)
creationalContext);



Mime
View raw message