TreeMap implementation is not synchronized. If multiple threads access TreeMap and atleast one thread updates the TreeMap, it must be synchronized externally. If no external synchronization, use
SortedMap m = Collections.synchronizedSortedMap(new TreeMap(...));
No comments:
Post a Comment