Skip to content

EnchantedList.remove is broken #286

Description

@Xavion3

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());

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions