From c6a00902aa0a2589f4ed5f9f871aa631c00ca92d Mon Sep 17 00:00:00 2001 From: Toby Jee Date: Sat, 16 Sep 2006 17:33:39 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@446903 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/struts2/dispatcher/SessionMap.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java b/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java index cd2c4b0aa..a6a34c38f 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/SessionMap.java @@ -85,11 +85,11 @@ public class SessionMap extends AbstractMap implements Serializable { } synchronized (session) { + entries = null; Enumeration attributeNamesEnum = session.getAttributeNames(); - String[] attributeNames = Collections.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()); + } } }