How to insert element to a HashMap while iterating it ?
807580Aug 24 2010 — edited Aug 25 2010Hi all,
I have a HashMap having <key, value> as <file name, size of file>.
Before iterating HashMap is loaded with some <key, value> pairs.
While iterating it I'm trying to find all files matching particular key (Pattern created from file name) and insert to the same HashMap.
This ends with a "ConcurrentModificationException".
Is there an alternative way of doing this within one loop ?
Thanks