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

Fix Command-Indexing #71

Closed kantenkugel closed 5 years ago

kantenkugel commented 6 years ago

Pull Request

Pull Request Checklist

Please follow the following steps before opening this PR.
PRs that do not complete the checklist will be subject to denial for missing information.

Pull Request Information

Check and fill in the blanks for all that apply:

Description

While investigating the source code for the command registry, i found some issues regarding the command indexing that was used if > 20 commands were registered:

This PR tries to fix those issues. The strategy of the index usage is now "Always use indexing" as already discussed with Jag.

Some minor code improvements are also included.

kantenkugel commented 6 years ago

As a note: I'm not entirely sure if the synchronization on the index is required. i kept it from the previous code (and added it to the method missing that sync), but eg the changes to the Command list were not synchronized for example