[seam-commits] Seam SVN: r13213 - branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Jun 17 07:32:39 EDT 2010


Author: manaRH
Date: 2010-06-17 07:32:38 -0400 (Thu, 17 Jun 2010)
New Revision: 13213

Modified:
   branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
Log:
JBPAPP-4492 - back ported JBSEAM-3512

Modified: branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java
===================================================================
--- branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java	2010-06-17 09:34:01 UTC (rev 13212)
+++ branches/enterprise/JBPAPP_4_3_FP01/src/main/org/jboss/seam/contexts/ServerConversationContext.java	2010-06-17 11:32:38 UTC (rev 13213)
@@ -289,12 +289,22 @@
           }
           removals.clear();
           //add new objects
-          for (Map.Entry<String, Object> entry: additions.entrySet())  {
-             Object attribute = entry.getValue();
-             passivate(attribute); 
-             session.put(getKey(entry.getKey()), attribute);
+          while (!additions.isEmpty())
+          {
+             // Copy the additions entries to a temporary variable, then
+             // clear additions - during passivation, further attributes may
+             // be set in the conversation context so we need to re-iterate
+             // through this process until all additions are passivated
+             Set<Map.Entry<String,Object>> entries = new HashSet<Map.Entry<String,Object>>(additions.entrySet());
+             additions.clear();
+            
+             for (Map.Entry<String, Object> entry: entries) 
+             {
+                Object attribute = entry.getValue();
+                passivate(attribute); 
+                session.put(getKey(entry.getKey()), attribute);
+             }
           }
-          additions.clear();
       }
       else
       {



More information about the seam-commits mailing list