openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r902117 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
Date Fri, 22 Jan 2010 15:27:26 GMT
Author: struberg
Date: Fri Jan 22 15:27:26 2010
New Revision: 902117

URL: http://svn.apache.org/viewvc?rev=902117&view=rev
Log:
OWB-247 in case of Reception.ALWAYS: only create a contextual reference if no contextual instance
already exists

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=902117&r1=902116&r2=902117&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
Fri Jan 22 15:27:26 2010
@@ -189,21 +189,15 @@
                 
                 creationalContext = manager.createCreationalContext(specializedComponent);
                 
-                if(this.ifExist)
-                {
-                    object = context.get(specializedComponent);
-                }
-                else
+                // lookup the contextual instance if one already exists
+                object = context.get(specializedComponent);
+                
+                if(object == null && !this.ifExist)
                 {
+                    // on Reception.ALWAYS we must get a contextual reference if we didn't
find the contextual instance
                     object = manager.getReference(specializedComponent, specializedComponent.getBeanClass(),
creationalContext);
                 }
                 
-
-                if (this.ifExist && object == null)
-                {
-                    return;
-                }
-
                 if (object != null)
                 {
                     //Invoke Method



Mime
View raw message