You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2014/12/26 19:34:09 UTC

svn commit: r1648006 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java

Author: rmannibucau
Date: Fri Dec 26 18:34:09 2014
New Revision: 1648006

URL: http://svn.apache.org/r1648006
Log:
Conversation.begin needs to throw ContextNotActiveException when it happens otherwise no way to ensure it is not active from 'client' point of view

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=1648006&r1=1648005&r2=1648006&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java Fri Dec 26 18:34:09 2014
@@ -26,6 +26,7 @@ import java.util.concurrent.atomic.Atomi
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.Conversation;
 import javax.enterprise.context.ConversationScoped;
 
@@ -144,9 +145,13 @@ public class ConversationImpl implements
                 manager.addConversationContext(this, (ConversationContext) webBeansContext.getBeanManagerImpl().getContext(ConversationScoped.class));
                 
             }
-            catch(Exception e)
+            catch (ContextNotActiveException cnae)
             {
-                //TCK tests
+                throw cnae; // expected by TCKs so throwing it before next catch recreates it
+            }
+            catch (Exception e)
+            {
+                //TCK tests, TODO: old ones? remove it?
                 manager.addConversationContext(this, new ConversationContext());
             }            
         }