[SPIGOT-2629] CME from spigot classloader Created: 25/Aug/16 Updated: 26/Aug/16 Resolved: 26/Aug/16 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Empire92 | Assignee: | md_5 |
Resolution: | Fixed | Votes: | 0 |
Labels: | bug, spigot | ||
Environment: |
java.specification.version: '1.8' |
Plugin: | PlotSquared, MassiveCore, others |
Description |
Occurs sometimes when an async thread initializes a new object during startup, in this case a JSONObject is being created. An issue was already reported for this, and incorrectly closed: Current stacktrace: More Debug information: Thanks. |
Comments |
Comment by Empire92 [ 26/Aug/16 ] |
welp thanks. |
Comment by md_5 [ 26/Aug/16 ] |
Would you please care to actually read my code? Thanks |
Comment by Empire92 [ 26/Aug/16 ] |
Not fixed, as per the docs, you need to synchronize while iterating, otherwise it will still throw a CME:
http://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#synchronizedMap-java.util.Map- |
Comment by Hex [ 26/Aug/16 ] |
PlotSquared looks like the loading of a class is being triggered from an async thread, then a plugin loader is being removed or added to the loader map before the class is resolved. The easiest fix as I can see would be synchronizing JavaPluginLoader.getClassByName(String), but there might be a smarter way. |