click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r986281 - /click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java
Date Tue, 17 Aug 2010 11:58:29 GMT
Author: bckfnn
Date: Tue Aug 17 11:58:29 2010
New Revision: 986281

URL: http://svn.apache.org/viewvc?rev=986281&view=rev
Log:
avoid unsafe initialization of static. suggested by findbugs.


Modified:
    click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java

Modified: click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java
URL: http://svn.apache.org/viewvc/click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java?rev=986281&r1=986280&r2=986281&view=diff
==============================================================================
--- click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java (original)
+++ click/trunk/click/extras/src/org/apache/click/extras/control/MenuFactory.java Tue Aug
17 11:58:29 2010
@@ -166,7 +166,7 @@ public class MenuFactory implements Seri
     protected final static Set<String> DEFAULT_ATTRIBUTES = new HashSet<String>();
 
     /** The menu cache. */
-    protected static Map<String, Menu> menuCache;
+    protected static final Map<String, Menu> menuCache = new ConcurrentHashMap<String,
Menu>();
 
     static {
         DEFAULT_ATTRIBUTES.add("name");
@@ -562,9 +562,6 @@ public class MenuFactory implements Seri
      * @return the map containing menus cached by name
      */
     protected Map<String, Menu> getMenuCache() {
-        if (menuCache == null) {
-            menuCache = new ConcurrentHashMap<String, Menu>();
-        }
         return menuCache;
     }
 



Mime
View raw message