- 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
This commit is contained in:
Toby Jee
2006-09-16 17:33:39 +00:00
parent 056ce629ca
commit c6a00902aa
@@ -85,11 +85,11 @@ public class SessionMap extends AbstractMap implements Serializable {
}
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());
}
}
}