Seeking Review: Make previously unsynchronized map synchronized

From: Edward Burns <>
Date: Thu, 12 Sep 2013 06:18:16 -0700

SECTION: Modified Files
M jsf-ri/src/main/java/com/sun/faces/application/view/

- I think it is more correct for the view map to be synchronized,
  because in the absence of JSF 2.2 clientWindowId usage, there is a
  very good possibility that multiple tabs on the same view, which will
  share a session, will end up colliding.

  Thank you very much to sseidel and LaVale for the suggestion and
  diagnostic information, and for the follow through!

Index: jsf-ri/src/main/java/com/sun/faces/application/view/
--- jsf-ri/src/main/java/com/sun/faces/application/view/ (revision 12515)
+++ jsf-ri/src/main/java/com/sun/faces/application/view/ (working copy)
@@ -42,6 +42,7 @@
 import com.sun.faces.application.ApplicationAssociate;
 import com.sun.faces.mgbean.BeanManager;
 import com.sun.faces.util.LRUMap;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.UUID;
@@ -270,7 +271,7 @@
                 if (sessionMap.get(ACTIVE_VIEW_MAPS) == null) {
- sessionMap.put(ACTIVE_VIEW_MAPS, (Map<String, Object>) new LRUMap<String, Object>(size));
+ sessionMap.put(ACTIVE_VIEW_MAPS, (Map<String, Object>) Collections.synchronizedMap(new LRUMap<String, Object>(size)));
                 Map<String, Object> viewMaps = (Map<String, Object>) sessionMap.get(ACTIVE_VIEW_MAPS);