mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
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
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user