myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1379879 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
Date Sat, 01 Sep 2012 22:28:14 GMT
Author: lu4242
Date: Sat Sep  1 22:28:14 2012
New Revision: 1379879

URL: http://svn.apache.org/viewvc?rev=1379879&view=rev
Log:
MYFACES-3598 ViewExpiredException during logout after the 3rd login 

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java?rev=1379879&r1=1379878&r2=1379879&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/renderkit/ServerSideStateCacheImpl.java
Sat Sep  1 22:28:14 2012
@@ -620,16 +620,28 @@ class ServerSideStateCacheImpl extends S
                 // into the map.
                 state = null;
             }
-            _serializedViews.put(key, state);
-
+            
             Integer maxCount = getNumberOfSequentialViewsInSession(context);
             if (maxCount != null)
             {
                 if (previousRestoredKey != null)
                 {
-                    _precedence.put((SerializedViewKey) key, previousRestoredKey);
+                    if (!_serializedViews.isEmpty())
+                    {
+                        _precedence.put((SerializedViewKey) key, previousRestoredKey);
+                    }
+                    else
+                    {
+                        // Note when the session is invalidated, _serializedViews map is
empty,
+                        // but we could have a not null previousRestoredKey (the last one
before
+                        // invalidate the session), so we need to check that condition before
+                        // set the precence. In that way, we ensure the precedence map will
always
+                        // have valid keys.
+                        previousRestoredKey = null;
+                    }
                 }
             }
+            _serializedViews.put(key, state);
 
             while (_keys.remove(key))
             {



Mime
View raw message