CodeSpells-Old
CodeSpells-Old copied to clipboard
EnchantedList.remove is broken
Causes java.util.ConcurrentModificationException when used. It's caused because it removes from eList while looping through eList. Example fix here
int index = 0;
for (Enchanted e : eList) {
if ((e.getId()).equals(ench.getId())) {
break;
}
index++;
}
eList.remove(index);
Log.log("I have just removed object with Id: "+ench.getId());