You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by tm...@apache.org on 2006/09/16 19:33:40 UTC

svn commit: r446903 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java

Author: tmjee
Date: Sat Sep 16 10:33:39 2006
New Revision: 446903

URL: http://svn.apache.org/viewvc?view=rev&rev=446903
Log:
WW-1448
  - SessionAware Session map clear() method not functioning correctly
  - added statement to nullify entries member variable, such that entrySet will not used invalid entries after clear() is called
  - use a better way to remove session attribute in clear() method.
  


Modified:
    struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java

Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java?view=diff&rev=446903&r1=446902&r2=446903
==============================================================================
--- struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java (original)
+++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java Sat Sep 16 10:33:39 2006
@@ -85,11 +85,11 @@
         }
 
         synchronized (session) {
+        	entries = null;
         	Enumeration<String> attributeNamesEnum = session.getAttributeNames();
-            String[] attributeNames = Collections.<String>list(attributeNamesEnum).toArray(new String[0]);
-            for (int a=0; a< attributeNames.length; a++) {
-            	session.removeAttribute(attributeNames[a]);
-            }
+        	while(attributeNamesEnum.hasMoreElements()) {
+        		session.removeAttribute(attributeNamesEnum.nextElement());
+        	}
         }
         
     }