From e713a9083b0802334d046915c9f1995326e8956c Mon Sep 17 00:00:00 2001 From: snowleo Date: Wed, 17 Oct 2012 22:30:45 +0200 Subject: [PATCH] Make the plugin class loader thread safe --- src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 10fc26a..4dca063 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -45,6 +45,7 @@ import org.bukkit.plugin.UnknownDependencyException; import org.yaml.snakeyaml.error.YAMLException; import com.google.common.collect.ImmutableList; +import java.util.concurrent.ConcurrentHashMap; /** * Represents a Java plugin loader, allowing plugins in the form of .jar @@ -61,14 +62,14 @@ public class JavaPluginLoader implements PluginLoader { @Deprecated protected final Pattern[] fileFilters = fileFilters0; - private final Map> classes0 = new HashMap>(); + private final Map> classes0 = new ConcurrentHashMap>(); /** * @deprecated Internal field that wasn't intended to be exposed */ @Deprecated protected final Map> classes = classes0; - private final Map loaders0 = new LinkedHashMap(); + private final Map loaders0 = new ConcurrentHashMap(); /** * @deprecated Internal field that wasn't intended to be exposed */ -- 1.8.1-rc2