Skip to content

MockHttpSession throws ConcurrentModificationException when removing attributes in a loop [SPR-7557] #12214

@spring-projects-issues

Description

@spring-projects-issues

Gaetan Pitteloud opened SPR-7557 and commented

The following code throws ConcurrentModificationException:

HttpSession session = new MockHttpSession();
session.setAttribute("k1", "v1");
session.setAttribute("k2", "v2");
for (Enumeration<String> names = session.getAttributeNames(); names.hasMoreElements();) {
   session.removeAttribute(names.nextElement());
}

The same code was OK prior Spring 3, and is OK on any web server, with non-mock http session implementation.


Affects: 3.0 M1, 3.0 M2, 3.0 M3, 3.0 M4, 3.0 RC1, 3.0 RC2, 3.0 RC3, 3.0 GA, 3.0.1, 3.0.2, 3.0.3, 3.0.4

Referenced from: commits aac2de9

Metadata

Metadata

Assignees

Labels

in: testIssues in the test moduletype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions