Revision: 7951
Author: [email protected]
Date: Tue Apr 20 07:22:11 2010
Log: Ensure static initialization is atomic (found by findbugs)

Review at http://gwt-code-reviews.appspot.com/341802

Review by: [email protected]
http://code.google.com/p/google-web-toolkit/source/detail?r=7951

Modified:
 /trunk/user/src/com/google/gwt/user/client/Cookies.java

=======================================
--- /trunk/user/src/com/google/gwt/user/client/Cookies.java Mon Jan 4 20:00:50 2010 +++ /trunk/user/src/com/google/gwt/user/client/Cookies.java Tue Apr 20 07:22:11 2010
@@ -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;
   }

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to