{"action":"opened","issue":{"url":"https://api.github.com/repos/InventivetalentDev/CompactNPCLib/issues/20","repository_url":"https://api.github.com/repos/InventivetalentDev/CompactNPCLib","labels_url":"https://api.github.com/repos/InventivetalentDev/CompactNPCLib/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/InventivetalentDev/CompactNPCLib/issues/20/comments","events_url":"https://api.github.com/repos/InventivetalentDev/CompactNPCLib/issues/20/events","html_url":"https://github.com/InventivetalentDev/CompactNPCLib/issues/20","id":171046927,"number":20,"title":"Concurrency issue on NPCRegistry.destroy()","user":{"login":"rlf","id":503044,"avatar_url":"https://avatars.githubusercontent.com/u/503044?v=3","gravatar_id":"","url":"https://api.github.com/users/rlf","html_url":"https://github.com/rlf","followers_url":"https://api.github.com/users/rlf/followers","following_url":"https://api.github.com/users/rlf/following{/other_user}","gists_url":"https://api.github.com/users/rlf/gists{/gist_id}","starred_url":"https://api.github.com/users/rlf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rlf/subscriptions","organizations_url":"https://api.github.com/users/rlf/orgs","repos_url":"https://api.github.com/users/rlf/repos","events_url":"https://api.github.com/users/rlf/events{/privacy}","received_events_url":"https://api.github.com/users/rlf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-14T07:45:09Z","updated_at":"2016-08-14T07:45:09Z","closed_at":null,"body":"## What steps will reproduce the problem?  \r\n1. Write a plugin that correctly supports `onEnable` and `onDisable` (i.e. PlugMan compatible)\r\n2. Use the `NPCRegistry` in onEnable, and call destroy in onDisable\r\n3. Sometimes (when the registry contains NPCs), you will get the stacktrace below:\r\n```\r\njava.util.ConcurrentModificationException\r\n        at java.util.HashMap$HashIterator.nextNode(Unknown Source) ~[?:1.8.0_60]\r\n        at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.8.0_60]\r\n        at org.inventivetalent.npclib.registry.NPCRegistry.destroy(NPCRegistry.java:51) ~[?:?]\r\n        at org.inventivetalent.npclib.registry.NPCRegistry.destroy(NPCRegistry.java:59) ~[?:?]\r\n        at com.github.rlf.pokeamon.PokeAMon.onDisable(PokeAMon.java:40) ~[?:?]\r\n```\r\n\r\n## What were you expecting to happen? What happened instead?  \r\nThe destroy method should either iterate over a copy of the data-model, or use the iterator to remove the items.\r\n\r\n## What version of the plugin are you using? *Type /version &lt;Plugin Name&gt;*  \r\n2.2.5\r\n\r\n"}}
{"actor":{"display_login":"rlf"}}