JDA-Applications / JDA-Utilities

A series of tools and utilities for JDA to assist in bot creation
Apache License 2.0
218 stars 111 forks source link

[Bug] ConcurrentModificationException with EventWaiter #60

Open Shengaero opened 6 years ago

Shengaero commented 6 years ago

Issue

Issue Checklist

Please follow the following steps before opening this issue.
Issues that do not complete the checklist may be closed without any help.

The issue tracker is reserved for issues, errors, and feature requests related to JDA-Utilities, and not questions and other requests for help.

Issue Information

Check all that apply:

This issue tracker does not assist or handle issues with the JDA library.
For JDA related issues, visit the JDA issue tracker and open an issue there.

Description

I am opening this issue after closing #57 as it will require a proper fix and not a simple 2 line patch.

As was previously stated in that PR, EventWaiter is currently not thread safe.

java.util.ConcurrentModificationException: null
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1442)
    at java.util.HashMap$KeyIterator.next(HashMap.java:1466)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:196)
    at com.jagrosh.jdautilities.commons.waiter.EventWaiter.onEvent(EventWaiter.java:239)