Summary: | ConcurrentModificationException | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Chris <chrispesarchick> |
Component: | HTTP | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | major | ||
Priority: | P3 | ||
Version: | 1.8 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux |
Description
Chris
2003-01-21 19:13:14 UTC
I just committed a change to org.apache.jmeter.testelement.AbstractTestElement that changed the new HashMap() to Collections.synchronizedMap(new HashMap()). I think this should help fix this problem, and not slow things down overly much. It's still not perfect, since to do a synchronized map correctly, you're supposed to manually synchronize iteration code, but since the Map is a private variable of AbstractTestElement, this is currently possible in other classes. One way to fix this would be to add a method to the TestElement interface, such as: getSyncObject() which would return the synchronized Map, so developers could write code such as: Iterater iter = testElement.getPropertyNames().iterator(); synchronized(testElement.getSyncObject()) { while(iter.hasNext()) { Object item = iter.next(); //do stuff safely } } It seems inelegant to me, but I'm not sure what a good alternative is. Using Hashtable is not viable, since Map's can hold null values, and Hashtables can't, and JMeter saves null values. I retried this with 1.8.1 and the problem is still there. This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1023 |