#956 使用ConcurrentHashMap替换HashTable

This commit is contained in:
liaochuntao
2019-03-01 15:06:54 +08:00
committed by Binary Wang
parent 28affd2d11
commit 5d7f69a984
4 changed files with 13 additions and 12 deletions

View File

@@ -10,9 +10,9 @@ import com.google.gson.JsonParseException;
import me.chanjar.weixin.common.util.json.GsonHelper;
import java.lang.reflect.Type;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* @author <a href="https://github.com/charmingoh">Charming</a>
@@ -36,7 +36,7 @@ public class WxMaVisitDistributionGsonAdapter implements JsonDeserializer<WxMaVi
}
JsonArray listArray = object.getAsJsonArray("list");
Map<String, Map<Integer, Integer>> list = new Hashtable<>(listArray.size());
Map<String, Map<Integer, Integer>> list = new ConcurrentHashMap<>(listArray.size());
for (JsonElement indexElement : listArray) {
JsonObject indexObject = indexElement.getAsJsonObject();
String index = GsonHelper.getString(indexObject, "index");