openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1678100 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/ConversationProducer.java
Date Wed, 06 May 2015 21:34:11 GMT
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");
+        }
     }
 }



Mime
View raw message