You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/08/11 19:54:57 UTC

svn commit: r564946 - /myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java

Author: skitching
Date: Sat Aug 11 10:54:56 2007
New Revision: 564946

URL: http://svn.apache.org/viewvc?view=rev&rev=564946
Log:
Ensure previous conversation is restored even when exception occurs in finally block.

Modified:
    myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java

Modified: myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java?view=diff&rev=564946&r1=564945&r2=564946
==============================================================================
--- myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java (original)
+++ myfaces/orchestra/trunk/core/src/main/java/org/apache/myfaces/orchestra/conversation/CurrentConversationAdvice.java Sat Aug 11 10:54:56 2007
@@ -65,15 +65,16 @@
 		}
 		finally
 		{
+			// Always restore the previous conversation (which may be null).
+			// Do this before anything else in case other methods throw exceptions.
+			Conversation.setCurrentInstance(previous);
+
 			conversation.leaveConversation();
 
 			if (conversation.isQueueInvalid())
 			{
 				conversation.invalidate();
 			}
-
-			// always restore the previous conversation (which may be null)
-			Conversation.setCurrentInstance(previous);
 		}
 	}
 }