fix HashMap Error...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092 2015-10-23 11:07:40 +08:00
parent 9d57a2aba3
commit 2cda8dec61

View File

@ -10,6 +10,7 @@ import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
@ -34,7 +35,7 @@ import cn.mcraft.gson.api.reflect.TypeToken;;
public class RepositoryManager { public class RepositoryManager {
Gson gson; Gson gson;
org.bukkit.plugin.Plugin main; org.bukkit.plugin.Plugin main;
HashMap<String, PluginInfo> plugins; Map<String, PluginInfo> plugins;
List<String> repos; List<String> repos;
@ -154,7 +155,7 @@ public class RepositoryManager {
return plugins.get(groupId + "." + artifactId); return plugins.get(groupId + "." + artifactId);
} }
public HashMap<String, PluginInfo> getPlugins() { public Map<String, PluginInfo> getPlugins() {
return plugins; return plugins;
} }
@ -171,7 +172,7 @@ public class RepositoryManager {
}.getType()); }.getType());
} }
if (plugincache != null && !plugincache.isEmpty()) { if (plugincache != null && !plugincache.isEmpty()) {
plugins = gson.fromJson(plugincache, new TypeToken<HashMap<String, PluginInfo>>() { plugins = gson.fromJson(plugincache, new TypeToken<Map<String, PluginInfo>>() {
}.getType()); }.getType());
} }
return true; return true;