You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2015/05/06 23:34:11 UTC

svn commit: r1678100 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java

Author: struberg
Date: Wed May  6 21:34:10 2015
New Revision: 1678100

URL: http://svn.apache.org/r1678100
Log:
OWB-1050 Conversation needs to throw ContextNotActiveException if no Session or ConversationContext exists

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java?rev=1678100&r1=1678099&r2=1678100&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java Wed May  6 21:34:10 2015
@@ -20,6 +20,7 @@ package org.apache.webbeans.portable;
 
 import java.util.Collections;
 
+import javax.enterprise.context.ContextNotActiveException;
 import javax.enterprise.context.ConversationScoped;
 import javax.enterprise.context.spi.Context;
 import javax.enterprise.inject.spi.AnnotatedType;
@@ -57,7 +58,10 @@ public class ConversationProducer extend
         {
             return ((ConversationContext) currentContext).getConversation();
         }
-
-        return null;
+        else
+        {
+            throw new ContextNotActiveException("WebBeans context with scope type annotation @ConversationScoped"
+                    + " does not exist within current thread");
+        }
     }
 }