myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1532604 - /myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java
Date Wed, 16 Oct 2013 00:06:07 GMT
Author: lu4242
Date: Wed Oct 16 00:06:07 2013
New Revision: 1532604

URL: http://svn.apache.org/r1532604
Log:
MYFACES-3792 ConcurrentModificationException in org.apache.myfaces.config.ManagedBeanDestroyer
- when using TomcatAnnotationLifecycleProvider

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java?rev=1532604&r1=1532603&r2=1532604&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/ManagedBeanDestroyer.java
Wed Oct 16 00:06:07 2013
@@ -20,22 +20,18 @@ package org.apache.myfaces.config;
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.Map;
+import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
 import javax.faces.event.PreDestroyCustomScopeEvent;
 import javax.faces.event.PreDestroyViewMapEvent;
 import javax.faces.event.ScopeContext;
 import javax.faces.event.SystemEvent;
 import javax.faces.event.SystemEventListener;
-import javax.servlet.ServletContext;
 
 import org.apache.myfaces.config.annotation.LifecycleProvider;
-import org.apache.myfaces.config.annotation.LifecycleProviderFactory;
-import org.apache.myfaces.context.servlet.StartupServletExternalContextImpl;
 
 /**
  * Destroyes managed beans with the current LifecycleProvider.
@@ -102,10 +98,16 @@ public class ManagedBeanDestroyer implem
             return;
         }
         
-        for (String key : scope.keySet())
+        if (!scope.isEmpty())
         {
-            Object value = scope.get(key);
-            this.destroy(key, value);
+            Set<String> keySet = scope.keySet();
+            String[] keys = keySet.toArray(new String[keySet.size()]);
+            
+            for (String key : keys)
+            {
+                Object value = scope.get(key);
+                this.destroy(key, value);
+            }
         }
     }
     



Mime
View raw message