Hallo Leute,
ich bekomme eine java.util.ConcurrentModificationException.
Kann jemand sagen wieso ich diese Exception bekomme?
Ich danke für Hinweise.. Gruss Huck
ich bekomme eine java.util.ConcurrentModificationException.
Java:
HashMap<String, Buch> tmpRegal = new HashMap<String, Buch>(regal);
Iterator<Buch> myIt = tmpRegal.values().iterator();
// Iterator<Buch> myIt = tmpRegal.keySet().iterator(); WÄRE MIR LIEBER ÜBER keys zu iterieren
// BLABLA
if (tmpRegal.size() > anotherLib.size()) {
while (myIt.hasNext()) {
String strC = myIt.next().getISBN(); // damit ich hier String strC = myIt.next(); mache
log.info("\t\t\t[ISBN] Check: "+strC);
if (!anotherLib.containsKey(strC)){
log.info("\t\t\t[defaultCAM] Request PK from: "+strC);
doRequestBook(strC);
}
tmpRegal.values().remove(strC);
}
}
Kann jemand sagen wieso ich diese Exception bekomme?
Ich danke für Hinweise.. Gruss Huck