For example if I use the List interface like this before:
List list = new ArrayList();
I will have to wrap the ArrayList implementation using the Collections synchronize method:
List list = Collections.sychronizedList(new ArrayList);
OR
List list = new ArrayList();
list = Collections.sychronizedList(list);
I hope this works. I will refactor my code now and will update this post once I find out what happens.
EDIT: It works! You just have to synchronize the list before iterating through them :)
yeah do that. xP should have done that before posting! :))
ReplyDelete