Creates new Iterator when returning the root subgroups as we are iterating it simultaneously

on different locations and we can see from time to time ConcurrentModificationException.
fix-message-formatting
Damian Minkov 12 years ago
parent 997c7787cf
commit fc1513734d

@ -36,6 +36,9 @@ public class RootContactGroupJabberImpl
*/
private Map<String, Contact> contacts = new Hashtable<String, Contact>();
/**
* The provider.
*/
private final ProtocolProviderServiceJabberImpl protocolProvider;
/**
@ -201,7 +204,7 @@ ContactJabberImpl findContact(String id)
*/
public Iterator<ContactGroup> subgroups()
{
return subGroups.iterator();
return new ArrayList<ContactGroup>(subGroups).iterator();
}
/**

Loading…
Cancel
Save