commit | d3bb45d60e2d160524fd939ada7606926e6d2f87 | [log] [tgz] |
---|---|---|
author | rice@google.com <rice@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Tue Apr 20 14:22:11 2010 +0000 |
committer | rice@google.com <rice@google.com@8db76d5a-ed1c-0410-87a9-c151d255dfc7> | Tue Apr 20 14:22:11 2010 +0000 |
tree | 7fbce73b59daa0cacc9f31d5cc79b45145f0f56f | |
parent | 6e5c766f9f4a5dadd60565bbe69c441f98cf420e [diff] |
Ensure static initialization is atomic (found by findbugs) Review at http://gwt-code-reviews.appspot.com/341802 Review by: kprobst@google.com git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7951 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/user/client/Cookies.java b/user/src/com/google/gwt/user/client/Cookies.java index f564b26..c30d50b 100644 --- a/user/src/com/google/gwt/user/client/Cookies.java +++ b/user/src/com/google/gwt/user/client/Cookies.java
@@ -228,8 +228,9 @@ private static HashMap<String, String> ensureCookies() { if (cachedCookies == null || needsRefresh()) { - cachedCookies = new HashMap<String, String>(); - loadCookies(cachedCookies); + HashMap<String, String> newCachedCookies = new HashMap<String, String>(); + loadCookies(newCachedCookies); + cachedCookies = newCachedCookies; } return cachedCookies; }