I'm running this code on a separate Thread (not the UI Thread)
strains = new ArrayList<Strain>();
for (Breeder b : breeders) {
for (Strain s : b.getStrains()) {
strains.add(s);
}
}
It sometime causes ConcurrentModificationException. I know that i can't add or remove object from a Collection that i'm iterating, but in this snippet I'm not iterating on strains. Where i'm wrong? Thanks