myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r891403 - /myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
Date Wed, 16 Dec 2009 19:46:26 GMT
Author: werpu
Date: Wed Dec 16 19:46:25 2009
New Revision: 891403

URL: http://svn.apache.org/viewvc?rev=891403&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-30
adding comment for the snapshot code

Modified:
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java?rev=891403&r1=891402&r2=891403&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
(original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/BaseWeaver.java
Wed Dec 16 19:46:25 2009
@@ -309,7 +309,16 @@
 
     }
 
-    private Map<String, ManagedBean> makeSnapshot(Map<String, ManagedBean> mbeans)
{
+    /**
+     * myfaces 2.0 keeps an immutable map over the session
+     * and request scoped beans
+     * if we alter that during our loop we get a concurrent modification exception
+     * taking a snapshot in time fixes that
+     *
+     * @param mbeans
+     * @return
+     */
+    private synchronized Map<String, ManagedBean> makeSnapshot(Map<String, ManagedBean>
mbeans) {
         Map<String, ManagedBean> workCopy = new HashMap<String, ManagedBean>(mbeans.size());
         for (Map.Entry<String, ManagedBean> entry : mbeans.entrySet()) {
             workCopy.put(entry.getKey(), entry.getValue());



Mime
View raw message