/*
   Copyright 2015 Wang Haomiao<et.tw@163.com>

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */
package cn.wanghaomiao.seimi.http.okhttp;

import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * okhttp cookie管理
 * @author 汪浩淼 [et.tw@163.com]
 * @since 2016/6/8.
 */
public class CookiesManager implements CookieJar {
    private final HashMap<String, List<Cookie>> cookieStore = new HashMap<>();
    @Override
    public synchronized void saveFromResponse(HttpUrl httpUrl, List<Cookie> cookies) {
        cookieStore.put(httpUrl.host(),cookies);
    }

    @Override
    public synchronized List<Cookie> loadForRequest(HttpUrl httpUrl) {
        List<Cookie> cookies = cookieStore.get(httpUrl.host());
        return cookies != null ? cookies : new ArrayList<Cookie>();
    }
}


@@ -712,16 +712,17 @@
 ttpUrl;%0A
+%0A
 import j
@@ -762,38 +762,81 @@
 til.
-HashMap;%0Aimport java.util.List
+List;%0Aimport java.util.Map;%0Aimport java.util.concurrent.ConcurrentHashMap
 ;%0A%0A/
@@ -981,20 +981,16 @@
 e final 
-Hash
 Map%3CStri
@@ -1025,16 +1025,26 @@
 e = new 
+Concurrent
 HashMap%3C
@@ -1073,29 +1073,16 @@
  public 
-synchronized 
 void sav
@@ -1221,21 +1221,8 @@
 lic 
-synchronized 
 List

Change to ConcurrentHashMap