--- a/jdk/src/java.base/share/classes/java/net/InMemoryCookieStore.java Thu Apr 23 18:01:01 2015 +0800
+++ b/jdk/src/java.base/share/classes/java/net/InMemoryCookieStore.java Thu Apr 23 09:32:35 2015 -0700
@@ -62,9 +62,9 @@
* The default ctor
*/
public InMemoryCookieStore() {
- cookieJar = new ArrayList<HttpCookie>();
- domainIndex = new HashMap<String, List<HttpCookie>>();
- uriIndex = new HashMap<URI, List<HttpCookie>>();
+ cookieJar = new ArrayList<>();
+ domainIndex = new HashMap<>();
+ uriIndex = new HashMap<>();
lock = new ReentrantLock(false);
}
@@ -115,7 +115,7 @@
throw new NullPointerException("uri is null");
}
- List<HttpCookie> cookies = new ArrayList<HttpCookie>();
+ List<HttpCookie> cookies = new ArrayList<>();
boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
lock.lock();
try {
@@ -157,7 +157,7 @@
* of this cookie store.
*/
public List<URI> getURIs() {
- List<URI> uris = new ArrayList<URI>();
+ List<URI> uris = new ArrayList<>();
lock.lock();
try {
@@ -281,7 +281,7 @@
String host, boolean secureLink) {
// Use a separate list to handle cookies that need to be removed so
// that there is no conflict with iterators.
- ArrayList<HttpCookie> toRemove = new ArrayList<HttpCookie>();
+ ArrayList<HttpCookie> toRemove = new ArrayList<>();
for (Map.Entry<String, List<HttpCookie>> entry : cookieIndex.entrySet()) {
String domain = entry.getKey();
List<HttpCookie> lst = entry.getValue();
@@ -368,7 +368,7 @@
cookies.add(cookie);
} else {
- cookies = new ArrayList<HttpCookie>();
+ cookies = new ArrayList<>();
cookies.add(cookie);
indexStore.put(index, cookies);
}